Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Manually running a .ps1 in an administrator (elevated) shell

$
0
0

I have a seemingly straightforward question: How can I manually run a .ps1 script on Server 2012 R2 and have it open in an administrator elevated shell?  I am right clicking and clicking "Run with Powershell" on the .ps1 file.

My environment:

Two Server 2012 R2 machines in the same domain in the same OU.  Both are full GUI installs. Both have UAC set to "default".

The discrepancy:

One of the servers will run any and all .ps1 files in an administrator elevated shell.  The other server will run any and all .ps1 files in a non-administrator, standard shell.  I have no idea what the differences are between the two servers.  Neither are running any custom Powershell profiles.

The following registry keys are all identical between the two servers:

HKEY_CLASSES_ROOT\Microsoft.PowerShellCmdletDefinitionXML.1

HKEY_CLASSES_ROOT\Microsoft.PowerShellConsole.1

HKEY_CLASSES_ROOT\Microsoft.PowerShellData.1

HKEY_CLASSES_ROOT\Microsoft.PowerShellModule.1

HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1

HKEY_CLASSES_ROOT\Microsoft.PowerShellSessionConfiguration.1

HKEY_CLASSES_ROOT\Microsoft.PowerShellXMLData.1

What am I missing?



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>