VMware Enterprise

VMware Enterprise

Knowledge is Power

  • About Me
  • Contact US
  • Disclaimer
  • General
  • Powershell

Creating and Removing domain accounts in each domain in a forest

April 6, 2022 Jeevan Bobba General, Powershell, Windows 23

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
}

  • Citrix Xen Desktop
  • Citrix Xenapp
  • creating account powershell
  • domain account
  • get-aduser
  • new-aduser
  • Powershell
  • remove-aduser
Previous

Created ISO image using PowerShell

Next

Get DC replication time response

RSS My News

  • Google Pixel 11 Launch Event: Everything We Expect As Price Increase Rumors Grow - Engadget July 27, 2026
    Google Pixel 11 Launch Event: Everything We Expect As Price Increase Rumors Grow  EngadgetGoogle confirms Pixel 11 price increase, reveals ‘dedicated’ effort to make Android more RAM-efficient  9to5GoogleGoogle confirms price increase for all Pixel phones, including upcoming flagship  NeowinGoogle confirms Pixel 11 price rise ahead of launch, blames global memory chip crunch  FirstpostNew leaked renders reveal every color option […]
  • PentesterFlow - AI Tool for Penetration Testers and Bug Hunters to Automate Workflows - CyberSecurityNews July 27, 2026
    PentesterFlow - AI Tool for Penetration Testers and Bug Hunters to Automate Workflows  CyberSecurityNews

Archives

  • July 2025
  • February 2025
  • April 2024
  • August 2022
  • June 2022
  • April 2022
  • March 2022
  • August 2021
  • January 2021
  • December 2020
  • June 2020
  • May 2020
  • April 2019
  • January 2019
  • August 2018
  • July 2018
  • May 2018
  • February 2018
  • January 2018
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • April 2017
  • January 2017
  • December 2016
  • November 2016
  • August 2016
  • July 2016
  • May 2016
  • April 2016
  • March 2016
  • October 2015

Recent Comments

    Categories

    • Azure
    • Citrix
    • General
    • Git
    • Linux
    • Powershell
    • Uncategorized
    • Vmware
    • Windows

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    RSS Google RSS

    • French president pledges support on visit to fire zone, vows: ‘We will win this battle together’ - AP News July 27, 2026
    • Trump to Axios: I'm ready for "strong military action" if Iran talks fail - Axios July 27, 2026
    • Savannah Guthrie delivers 'very specific' message to mom's kidnapper 25 weeks after her abduction - Fox News July 27, 2026
    • Live Updates: U.S.-Iran war appears to pause as Trump gives space for talks to end Strait of Hormuz standoff - CBS News July 27, 2026

    RSS Technology

    • Apple Releases iOS 26.6 and iPadOS 26.6 With iOS 27 Optimizations - MacRumors July 27, 2026
      Apple Releases iOS 26.6 and iPadOS 26.6 With iOS 27 Optimizations  MacRumorsiOS 26.6 fixes over 75 security issues with your iPhone, update now  9to5MacApple rolls out watchOS 26.6 update for Apple Watch  AppleInsideriOS 26.6 Update Now Available With 3 New Features  bgr.comiOS 26.6 Release: Next iPhone Update Is Almost Here, Here’s The Target Date  Forbes
    • ChatGPT starts blocking direct requests to copy an author’s style - Ars Technica July 27, 2026
      ChatGPT starts blocking direct requests to copy an author’s style  Ars Technica

    Recent Posts

    • Git Command Cheat Sheet for Beginners
    • Mastering Credential Management in PowerShell: A Comprehensive Guide
    • Discovering Share Permissions(ACL) on Windows Servers using PowerShell
    • Get Duplicate users in a forest
    • Get users Group and members of the groups

    Copyright © 2026 | WordPress Theme by MH Themes