• Home
  • BLOGS

Menu
  • Home
  • BLOGS
09 January 2020

Active Directory Script – update users UPN from txt file

Written by Ryan Wilson

$oldSuffix = “olddomain.com”

$newSuffix = “newdomain.com”

Get-Content “C:\files\users.txt” | Get-ADUser | ForEach-Object {

$newUpn = $_.UserPrincipalName.Replace($oldSuffix,$newSuffix)

$_ | Set-ADUser -UserPrincipalName $newUpn

}

Leave a Reply

Cancel reply

Recent Posts

  • Serverless LAPS using Azure function and Secret Key Vaults
  • MS Teams – export team owners
  • Deploy AppLocker in Intune- Block CMD and PowerShell
  • Autopilot Hybrid Joined device built outside the corporate network
  • Add a SharePoint site as a custom app within Teams
  • Query all MS Teams and Export list of guests added to each Team site
  • MS Flow – adding timestamp in the middle of a filename whilst retaining file extension
  • MS Flow to export outlook attachment into a Teams channel and notify users with an adaptive card
  • Unlicense Office suite using last 5 characters
  • Azure Information Protection – We were not able to find the Information Rights Management template.

Recent Comments

  • Ged on MS Flow to export outlook attachment into a Teams channel and notify users with an adaptive card
  • film on Autopilot Hybrid Joined device built outside the corporate network
  • Ryan Wilson on Azure Information Protection – We were not able to find the Information Rights Management template.
  • BurtonMBrohl on Azure Information Protection – We were not able to find the Information Rights Management template.
  • Ryan Wilson on Azure Information Protection – We were not able to find the Information Rights Management template.
  • RayeXDuesing on Azure Information Protection – We were not able to find the Information Rights Management template.
  • TroyTHulette on Azure Information Protection – We were not able to find the Information Rights Management template.
  • NildaZAdamos on Azure Information Protection – We were not able to find the Information Rights Management template.
  • Ryan Wilson on Azure Information Protection – We were not able to find the Information Rights Management template.
  • NoahVSolak on Azure Information Protection – We were not able to find the Information Rights Management template.

Archives

  • March 2021
  • December 2020
  • November 2020
  • October 2020
  • August 2020
  • June 2020
  • May 2020
  • February 2020
  • January 2020
  • December 2019
  • July 2019

Categories

  • IT Blogs (20)
© Copyright 2017. Theme by BloomPixel.