AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Run powershell as different user9/8/2023 The window that opens, however, looks like a command prompt windows (white text on black background) instead of like a PowerShell window (white text on a blue background). Start-Process powershell.exe -Credential $credential -WindowStyle Maximized # Launch PowerShell (runas) as another user $credential = New-Object $username, $securePassword $securePassword = ConvertTo-SecureString $password -AsPlainText -Force Start -Process powershell.exe -Credential $credential -WindowStyle Maximized # Define domain username and password $username = 'domain\user' $password = 'kvnbZJSSJAUTBFB5' # Convert to a single set of credentials $securePassword = ConvertTo-SecureString $password -AsPlainText -Force $credential = New-Object $username, $securePassword # Launch PowerShell (runas) as another user Create the script using the Enable-ADAccount cmdlet or Set-ADUser cmdlet, and execute it in the PowerShell window.
0 Comments
Read More
Leave a Reply. |