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

Trying to add two scripts together and run as administrator

$
0
0

I am trying to put all of these scripts together and I cant seem to get it. I think it has something to do with my format. It always has an error saying it needs to be ran as admin but I cant seem to get it working. any ideas? Thank you!

{add-computer -newname jimmy123 -domainname ddemo.com -credential administrator}

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Value 3
([ADSI] "WinNT://localhost/Administrators").remove('WinNT://localuser')
([ADSI] "WinNT://localhost/Administrators").add('WinNT://ddemo.com/jimmyj')
{enable-psremoting -force}

Viewing all articles
Browse latest Browse all 15028

Trending Articles



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