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}