Created domain account in each domain add it to domain admin group
$domains = (get-adforest).domains
foreach($domain in $domains){
$accountname = ‘s-coe-‘+($domain -split “.”)[0]+’-DA’
$accountpass = ‘P@ssword123456’ | ConvertTo-SecureString -Force -AsPlainText
Write-Output “Working on $domain – DA is $accountname”
New-ADUser -name $accountname -SamAccountName $accountname -AccountPassword $accountpass -Enabled $true -Server $domain
start-sleep -Seconds 5
Add-ADGroupMember -Identity “Domain Admins” -Members $accountname -Server $domain
}
Remove domain account in each domain
$domains = (get-adforest).domains
foreach($domain in $domains){
$accountname = ‘s-coe-‘+($domain -split “.”)[0]+’-DA’
get-aduser $accountname -Server $domain | Remove-ADUser -Server $domain -Verbose -Confirm:$false
}
TwJRBtA BVrbROwj CGLYKSdu nQsk jadHRwYO hefg
I was reading through some of your content on this site and I think this site is real instructive! Keep on putting up.
Hey There. I found your blog using msn. This is a really well written article. I’ll be sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll definitely comeback.
I have not checked in here for some time as I thought it was getting boring, but the last few posts are good quality so I guess I will add you back to my everyday bloglist. You deserve it my friend 🙂
Thanks for another informative site. Where else may just I am getting that type of information written in such an ideal approach? I have a challenge that I am simply now operating on, and I have been on the glance out for such info.
I would like to thnkx for the efforts you have put in writing this site. I am hoping the same high-grade site post from you in the upcoming also. Actually your creative writing abilities has inspired me to get my own blog now. Really the blogging is spreading its wings quickly. Your write up is a great example of it.