Windows IT

Clear2all Professional Blog new

Copy Group memebership using PowerShell from one user to another

Copy Group memebership using PowerShell from one user to another

Run Powershell as administrator (wasted 1 hr figuring this out. It does not work if not run as admin)

Import-module activedirectory

Then below command which accepts samaccount name of both users

Get-ADUser -Identity copyfrom -Properties memberof | Select-Object -ExpandProperty memberof | Add-ADGroupMember -Members Copyto
Read the rest

Clear2all Professional Blog new

Add Calendar Permissions in Office 365 via Powershell using Add-MailboxFolderPermission

Add Calendar Permissions in Office 365 via Powershell using Add-MailboxFolderPermission

Step by Step Guide for setting calendar permissions in Office 365:

First step would be launch Powershell as Administrator.

Second would be to open a new PS Session on powershell to Exchange Online/Office 365 using below commands.

$GetCred = Get-Credential


$PSSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $GetCred -Authentication Basic -AllowRedirection


Import-PSSession $PSSession

Now the last step is to configure the permissions for the user2 permissions on user1 calendar using below Powershell:

Add-MailboxFolderPermission -Identity [email protected]:\calendar -user [email protected] -AccessRights Editor

These are the available permissions levels for above -AccessRights are

Read the rest
Clear2all Professional Blog new

Checking Exchange GUID while migrating mailbox Exchange to Office365

Checking Exchange GUID while migrating mailbox Exchange to Office365

Below commands can be really helpful while exchange 2010 to office 365 migration.

Below command to import the csv file with names and email addresses of users to be checked.

$CSV = Import-CSV C:\Temp\spotcheck.csv

Below command to display names, email addresses,GUID etc of users to be checked.

$CSV | foreach { get-mailuser -identity $_.mail | fl DisplayName, WindowsEmailAddress, PrimarySmtpAddress, RecipientType, ExternalEmailAddress, ExchangeGuid}

Below command to display names, email addresses,GUID etc of users to be checked exported to a csv file

$CSV | foreach { get-mailuser -identity $_.mail} | select DisplayName, WindowsEmailAddress, Read the rest

Clear2all Professional Blog new

Change UPN on Office365 manually using Powershell

Change UPN on Office365 manually using Powershell

In some circumstances the UPN changes on on-premise do not get updated to Azure/Office365. If you are syncing from your on-premise AD then updating the UPN in Azure using powershell is going to get overwritten the next time that your sync process runs but in a situation where its changed to correct value then it will just be replaced by same value. This manual process can be used for speeding up the change or making the change if sync is unsuccessful.

If I have understood the question correctly then by updating the UPN … Read the rest

Clear2all Professional Blog new

Powershell script to ping a list of servers or IP Addresses

Powershell script to ping a list of servers or IP Addresses

Below script can be used as a Powershell script to ping a list of servers or IP Addresses


$ServerName = Get-Content "C:\Users\vb\Desktop\computerslist.txt"

foreach ($Server in $ServerName) { if (test-Connection -ComputerName $Server -Count 2 -Quiet ) { "$Server is Pinging " } else {"$Server not pinging" } }

For Example the Computerslist Text file can have one entry on each line like below having either PC name or IP Addresses

pc1.domain.com
pc2.domain.com
10.100.128.10

Results will be like below for above text file.

pc1.domain.com is Pinging
pc2.domain.com is Pinging
10.100.128.10 is … Read the rest