You really shouldn’t be using STSADM anymore. PowerShell is a far more robust and flexible replacement.
But for any old school admins out there, you may want to know that you can technically execute your beloved STSADM commands from within PowerShell directly. But you first need to tell PowerShell where to find STSADM executable.
You do this using the PowerShell Set-Alias cmdlet.
For example, here’s how you would execute the migrateuser STSADM command from within PowerShell:
set-alias STSADM "${env:commonprogramfiles}\Microsoft Shared\Web Server Extensions\14\BIN\STSADM.EXE" STSADM -o migrateuser -oldlogin OLDDOMAIN\old_username -newlogin NEWDOMAIN\new_username -ignoresidhistory
If you’re in the process of switching from STSADM to PowerShell, you may find this comprehensive STSADM to PowerShell mapping list pretty useful.
Leave a Reply