Showing posts from April, 2017

Powershell command to Get UPN of all the users in Active Directory also Export to CSV

- Open Powershell in Elevated Mode
- Run the following command :

Get-ADUser -Filter * -Properties DisplayName, EmailAddress, Title, userPrincipalName | select DisplayName, EmailAddress, Title, userPrincipalName | Export-CSV "C:\UPN_Addresses.csv"

- You will get the Output in following format :

Download Remote Control Tool for Free :

How to create Bulk Users in Active Directory !!

Firstly Create a CSV file in following format :

Go through the CSVformat (Some pointers explained)

Path : Would be the path where you want the Users to get created.

How to find the path :

- Open Active Directory Users and Computer
- Expand your Domain Name / Organization name
- Right Click on the OU where you want the users to get created
- Click on Properties
- Click on Attribute Editor
- Look for Distinguish Name , copy the value
- Paste that in the path of the CSV file

UserPrincipleName : This can vary depending upon the email servers and even .local addresses can appended in there. It has to match your domain name standards.

After adding all the details in the CSV file , save that as bulkupload.csv and copy the file to the Active Directory Server. I am placing my file on the Desktop of the AD server.

Open Windows PowerShell in Elevated permissions (Run As Administrator) and run the following command after modifying the .csv file path.

Import-Csv "C:\Users\binuk\Desktop\bulkuploa…

Recall / Delete a message sent to all the users by mistake - O365

First of all Open Azure PowerShell with Admin Privileges
Connect to O365 (Run the command mentioned below - Input O365 Global Admin Credentials)

Import-Module MSOnline
$O365Cred = Get-Credential

$O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session -AllowClobber
Connect-MsolService -Credential $O365Cred

Run the following command to delete the message :

Get-Mailbox |Search-Mailbox -SearchQuery 'Subject:"Type the subject of the message"' -DeleteContent

Confirm the deletion , Either one by One or Typing A for all

It will take some time as it will go through all the mailboxes to find the mentioned subject email.…

How to find the Profile GUID for all the Users logging on to a Machine (For example RDS machine or Domain Controller)

If suppose you want to work on the GUID's in the registry and don't want to go through all the GUID's one by one, then you can try running the following command to get the list of all the Users with their profile GUID's , which make your life easier to troubleshoot.

Open Elevated PowerShell / Command prompt and run the following command:
wmic useraccount get name,sid >C:\Profile.txt

Output format:

Registry Path for Profile List :

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

Download : WinGag Remote Control Software