Posts

Unlock a local account on a remote system using WMIC.exe

You can use the wmic.exe command line tool that comes with XP, Vista, and Windows 7 to run remote commands on a system. The command to unlock an account on a local system is: net user [username] /active:yes The command to unlock a local account on a remote system is: wmic /node:[IP Address] process call create "net user [username] /active:yes" For more on the WMI command check out this article on Microsoft's Technet: http://technet.microsoft.com/en-us/library/bb742610.aspx And just as a final note, the command to unlock a domain account in the domain you are logged into is: net user [username] /domain /active:yes

How To use ASPNET_SetReg to store encrypted data in the registry and then decrypt the data for use in your app

1) You may find it a bit unsecure storing usernames and passwords inside your web.config.  As an alternative to doing this, Microsoft has established a standard way to store that type of info in the registry of your server instead.  Yes, you can encrypt portions of the web.config using aspnet_regiis, but it can become quite a hassle if you need to make changes to some of your appSettings keys or change the account password over a number of different applications.   ( http://msdn.microsoft.com/en-us/library/dtkwfdky.aspx ) 2) You can use a simple command line tool called aspnet_setreg.exe to create your registry entries.     You can find the tool here:              http://support.microsoft.com/kb/329290     The tool will use CryptProtectData to encrypt the values you put in the registry. The example in the article uses the following example: Run the following command...

Sharepoint Windows Workflow Foundation: Passing the Workflow Correlation Token to a Custom Activity

In windows workflow foundation, you can create custom activities that contain a subset of your workflow activities.  By default, the custom activity does not have access to the workflow correlation token which is created in the main workflow and used by the OnWorkflowActivated activity at the start of the main workflow. However, there are some activities within the custom activity that you may want to use that need to use the workflow correlation token to work.  The SendEmail activity, and the OnWorkflowItemChanged are two activities that require the use of the workflow correlation token.  Check out the following post for a nice article on correlation tokens. http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?PageType=4&ListId={72C1C85B-1D2D-4A4A-90DE-CA74A7808184}&pID=863 I had found the following post with a sample of how this could be done, but the code listed in the post wasn't complete, and it took me several hours to figure out how to get...