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
}
umactc
l6geaa
pp09cm
It’s appropriate time to make a few plans for the longer term and it’s time to be happy. I’ve learn this put up and if I may I desire to suggest you some fascinating things or suggestions. Maybe you could write next articles regarding this article. I desire to learn more things approximately it!
This is a very good tips especially to those new to blogosphere, brief and accurate information… Thanks for sharing this one. A must read article.
I am glad to be a visitor of this utter web site! , thankyou for this rare info ! .
You really make it seem so easy with your presentation but I in finding this topic to be actually something which I feel I might by no means understand. It seems too complex and very extensive for me. I am taking a look ahead in your subsequent publish, I’ll try to get the cling of it!
Way cool, some valid points! I appreciate you making this article available, the rest of the site is also high quality. Have a fun.
iafasd