Sometimes you need to run an executable as a different user via command prompt:
- in scripts
- in Windows 2008 (not 2008 R2), you cannot use shift right click to "run as different user"
Windows come with a command line tool called "runas", which allow users to execute anything as a different user, in the following syntax
runas /user domain\username "full path to exe"
ie.
runas /user domain\username "c:\temp\temp.exe /a /l /r"
Wednesday, November 23, 2011
Tuesday, November 15, 2011
Active Directory MMCs and Command Line Tools
Administration Tools on your Windows XP/7:
If you need to manage/export data from AD outside of your windows server, install:
- the "Windows Server 2003 Administration Tools Pack" (for windows 2003 AD servers)
http://www.microsoft.com/download/en/details.aspx?id=16770
OR
- the "Remote Server Administration Tools for Windows 7" (for windows 2008 AD servers)
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=7887
They provide Active Directory related MMCs and Directory Services command line tools.
Quickly Exporting AD Information
Dsquery.exe allows you to find any users/groups/OUs/computers etc based on their name/attributes
http://technet.microsoft.com/en-us/library/cc732952(WS.10).aspx
Examples:
To retrieve all AD Groups with the prefix "foo"
dsquery group -name foo*
To retrieve all the users in the container "Users", domain "microsoft.com"
dsquery user cn=users,dc=microsoft,dc=com
Other AD Command Line Tools
Microsoft has also allowed you to perform most basic AD operations such as adding users/groups, resetting passwords, deleting accounts/groups via the command-line tools
http://support.microsoft.com/kb/322684
If you need to manage/export data from AD outside of your windows server, install:
- the "Windows Server 2003 Administration Tools Pack" (for windows 2003 AD servers)
http://www.microsoft.com/download/en/details.aspx?id=16770
OR
- the "Remote Server Administration Tools for Windows 7" (for windows 2008 AD servers)
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=7887
They provide Active Directory related MMCs and Directory Services command line tools.
Quickly Exporting AD Information
Dsquery.exe allows you to find any users/groups/OUs/computers etc based on their name/attributes
http://technet.microsoft.com/en-us/library/cc732952(WS.10).aspx
Examples:
To retrieve all AD Groups with the prefix "foo"
dsquery group -name foo*
To retrieve all the users in the container "Users", domain "microsoft.com"
dsquery user cn=users,dc=microsoft,dc=com
Other AD Command Line Tools
Microsoft has also allowed you to perform most basic AD operations such as adding users/groups, resetting passwords, deleting accounts/groups via the command-line tools
http://support.microsoft.com/kb/322684
Thursday, October 27, 2011
Execute Large SQL files
sqlcmd -d [DatabaseName] -S [ServerName] -i [sql script file] -o [output file]
Saturday, September 3, 2011
Mobile Development Resources
Flex Resources
The following Flex ebooks are not too hard to find on the www:
- Flex in a week 4.5
- Adobe Flex 4.5 Fundamentals: Training from the Source
- Flash Builder 4 and Flex 4 Bible
- Enterprise Development with Flex (Adobe Dev Lib) 2010
Why MonoTouch And Mono For Android
Visual Studio Themes - Dark Background
If you are using a mild VS theme which has a grey background and light brown text:
you may have problems with some html tags having the same color as its text. You need to change the "default" color 0x020000000 to your desired color.
you may have problems with some html tags having the same color as its text. You need to change the "default" color 0x020000000 to your desired color.
http://www.hanselman.com/blog/ChangingYourColorsInVisualStudioNETBlackVersusWhite.aspx
The standard options to look out for are options-fonts->
The standard options to look out for are options-fonts->
- Razor
- Plain Text
- Line Numbers
- Comments
- Identifier
- Keyword
- Operator
- String
- UserTypes
Removing Empty Folders In Command Prompt
For a quick way to batch remove all empty folders, "cd" into that folder and perform the following:
for /f "usebackq delims=" %d in (`"dir /ad/b/s | sort /R"`) do rd "%d"
Please backup the source folder before doing so, just in case. Afterwards, you can use beyond compare and order by folder size to compare the results.
for /f "usebackq delims=" %d in (`"dir /ad/b/s | sort /R"`) do rd "%d"
Please backup the source folder before doing so, just in case. Afterwards, you can use beyond compare and order by folder size to compare the results.
Tuesday, August 30, 2011
Salesforce Long Text Area and Formulas
If you try to create a formula on a "Long Text Area" field, salesforce does not support this.
One workaround is to create a new field and another workflow to perform a "field update" on this:
Step 1) Create a new field with data type of "Text Area (Long)"
Step 2) Create a workflow with the following settings:
Evaluation Criteria -> select "Every time a record is created or edited"
Rule Criteria -> select "Formula evaluates to true" and type "true"
Step 3) Select "Add Workflow Action" -> "New Field Update"
Step 4) Select the newly created field as the "Field To Update" and select "Use a formula to set the new value" under "Specify New Field Value"
Step 5) You can now enter in a formula that reference other "Long Text Area" fields. The results will be posted to the new field of type "Long Text Area".
Reasons Behind This Solution
Basically this allows complex logics, ie perform formula calculations on a long text field, to be offloaded to a workflow which runs on the background. As a normal formula needs to be calculated very often and can slow down the page on each load/save, shifting the calculations to workflow helps salesforce lower the CPU usage.
One workaround is to create a new field and another workflow to perform a "field update" on this:
Step 1) Create a new field with data type of "Text Area (Long)"
Step 2) Create a workflow with the following settings:
Evaluation Criteria -> select "Every time a record is created or edited"
Rule Criteria -> select "Formula evaluates to true" and type "true"
Step 3) Select "Add Workflow Action" -> "New Field Update"
Step 4) Select the newly created field as the "Field To Update" and select "Use a formula to set the new value" under "Specify New Field Value"
Step 5) You can now enter in a formula that reference other "Long Text Area" fields. The results will be posted to the new field of type "Long Text Area".
Reasons Behind This Solution
Basically this allows complex logics, ie perform formula calculations on a long text field, to be offloaded to a workflow which runs on the background. As a normal formula needs to be calculated very often and can slow down the page on each load/save, shifting the calculations to workflow helps salesforce lower the CPU usage.
Subscribe to:
Posts (Atom)