Correct scripts

This commit is contained in:
Mario Fetka 2014-08-19 17:53:04 +02:00
parent a7fba7bcef
commit c0dfef4f98

View File

@ -15,7 +15,6 @@ ShellBatch_JoinDom
; mit wahl des ou pfades also abhängig ob ou-pfad leer den aufrunf ändern.
; Add-Computer -domainname DOMAIN -OUPath "OU=OU1,OU=OU2,OU=Domainname,DC=company,DC=com" -cred DOMAIN\AuthorizedUser -passthru verbose
[PatchTextFile_Create_powershell]
AddLine "$secpasswd = ConvertTo-SecureString '$password$' -AsPlainText -Force"
AddLine '$mycreds = New-Object System.Management.Automation.PSCredential ("$user$", $secpasswd)'
@ -23,6 +22,6 @@ AddLine 'Add-Computer -DomainName "$dom$" -credential $mycreds'
SaveToFile "c:\joinpatched.ps1"
[ShellBatch_JoinDom]
set-executionpolicy RemoteSigned
powershell c:\joinpatched.ps1
powershell set-executionpolicy RemoteSigned
powershell -File c:\joinpatched.ps1
del c:\joinpatched.ps1