Skip to content

Instantly share code, notes, and snippets.

View lavahot's full-sized avatar
🕺
Let's boogey

Taylor Mansfield lavahot

🕺
Let's boogey
View GitHub Profile
@lavahot
lavahot / create_gmsa_windows_servers.ps1
Last active September 30, 2019 23:21 — forked from jibinpb/create_gmsa_windows_servers.ps1
Create gMSA for Windows Servers
Import-module activedirectory
$gMSAName = 'gMSA_Account_Name' ## Replace this value with new gMSA Name
$serverList = 'Server001','Server002','Server003','Server004','Server005' ## Replace with Server Names
$adOU = 'ou=Managed Service Accounts,OU=Service Accounts,DC=your_company,DC=com' ## Replace with actual AD OU
## Checking whether organizational unit exists, if not create it.
$ous = dsquery ou "$adOU"
if ($ous.count -eq 0) {
dsadd ou "$adOU"