You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$comp='the-remote-pc-name'# Connect to the remote computerEnter-PSSession$comp# Set up an unrestricted account configuration file:New-PSSessionConfigurationFile-RunAsVirtualAccount -Path $env:TEMP\VirtualLocalAdmin.pssc
# Might need to reconnect after the following:Register-PSSessionConfiguration-Name 'VirtualLocalAdmin'-Path $env:TEMP\VirtualLocalAdmin.pssc -Force
# List the config permissions:Get-PSSessionConfiguration-Name 'VirtualLocalAdmin'# The accounts/groups listed will have unrestricted access to the system via remote PowerShell.# Using this virtual account will be acting as if a fully local admin.Exit
From your local workstation connect to the remote computer and install RSAT tools
# Connect to the remote computer using the virtual accountEnter-PSSession$comp-ConfigurationName 'VirtualLocalAdmin'# Pick one - all RSAT tools or the example of just ADUC:# Add-WindowsCapability -Online -Name 'Rsat*' -Verbose# Add-WindowsCapability -Online -Name 'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0' -Verbose# Output when successful: # Online : True# RestartNeeded : FalseExit
Clean up the virtual account configuration
# Connect to the remote computerEnter-PSSession$comp# Unregister the virtual account configurationUnregister-PSSessionConfiguration-Name 'VirtualLocalAdmin'# Remove the configuration fileRemove-Item$env:TEMP\VirtualLocalAdmin.pssc
Exit