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

How can I pass domain admin credentials in powershell to create users?

$
0
0

I would like to have my HR department create user accounts for new employees. In vbscript I could do something like 

Const ADS_SECURE_AUTHENTICATION = 1

Set ou_SES = DirectoryService.OpenDSObject ("LDAP://OU=Elementary,OU=Students,OU=Sidney Central School Network Users,DC=sidney,DC=k12,DC=ny,DC=us","administrator","password",ADS_SECURE_AUTHENTICATION)

How can I pass the admin username/password in PowerShell? My plan was to hard code it in and then encript the script.

Thank you


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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