If, like any sane sysadmin, you adhere to best practice and your own user account isn’t a domain admin, you’re likely to be running certain operations as a domain admin.
I’ve used batch files to run CMD, MMC, and other applications as a domain admin account in the past. To run PowerShell, I had to use a slightly different method.
1. Create a PowerShell script that contains the following, and save it somewhere:
Start-Process powershell.exe -Credential "domainadministrator"
2. Create a shortcut on your desktop or similar, with the following path:
%SystemRoot%system32WindowsPowerShellv1.0powershell.exe -File C:pathtoscriptRun-PowerShell-Elevated.ps1
3. Optionally, set the shortcut icon to one of the ones contained in the PowerShell exe. I used the UAC one.
To test that it worked, run the script, authenticate, and then do the following:
Set-Location env:
dir
You should see that the username matches the one you started the process as.