Monthly Archives: March 2021

Get list of users created in AD within last few days

Using PowerShell we can get list of users created during a particular time frame, like in last 1 day, 30 days, etc. This may be helpful in AD audit or to track any security breach.

First, create a variable and store the date you want to go back.

Make sure you run the PowerShell as Admin, if you don’t you may get blank values for WhenCreated

$When = (Get-Date).AddDays(-30) # You can change number of days here as per your requirement. 
Get-ADUser -Filter {WhenCreated -ge $when}

#IF you want to list particular properties, you can use below command.
Get-ADUser -Filter {WhenCreated -ge $when} -Properties * | FT Name, UserPrincipalName, WhenCreated

We can also get group membership of these users in same command output.

Get-ADUser -Filter {whenCreated -ge $when} -Properties * | select UserPrincipalname, SamAccountName, Enabled, whenCreated, @{n="GroupMembership"; e={$_.MemberOf | foreach {(Get-ADGroup $_).Name}}}

Export this list to CSV file.

Get-ADUser -Filter {whenCreated -ge $when} -Properties * | select UserPrincipalname, SamAccountName, Enabled, whenCreated, @{n="GroupMembership"; e={$_.MemberOf | foreach {(Get-ADGroup $_).Name}}} | Export-CSV C:\Temp\ADUsersWhenCreated.csv -notype

Maximize Teams meeting shared content

When you are in a Teams meeting and someone is sharing content from their screen. In the new Teams meeting experience Teams meeting window open in a separate window and chat in a separate window and the sharing window size is really small.

We can turn off “New Teams meeting experience” but then we will have one single window for meeting and chat. though, we will have “Full Screen” option and can see large window when someone is sharing screen.

To turn off New Teams meeting experience go to Settings->General->Application -> Uncheck “Turn on new meeting experience”. This option is not available in new Teams versions.

Though, we can increase the sharing Teams window size in new meeting experience also.

To use Full Screen in sharing window.

Click on the “More Actions” (Three dots at the top of Teams Window) -> Click on “Full Screen”

Go to more actions again and click on Focus.

If the Window size is still small, you can also Zoom in the shared window.

Just press Ctrl key on keyboard + (rotate mouse wheel up) to increase Zoom in or rotate mouse wheel down to zoom out.

Zoom inCtrl+= or Ctrl+(rotate mouse wheel up)Command+= or Command+(rotate mouse wheel up)
Zoom outCtrl+- or Ctrl+(rotate mouse wheel down)Command+- or Command+(rotate mouse wheel down)
Reset zoomCtrl+0Command+0

How to Copy Other User’s OneDrive Data to your OneDrive

There are situations when we need to copy one user’s OneDrive data to another user’s OneDrive. For example a user leaving company and his manager wants all the project related files from his OneDrive. By default when we remove user’s license OneDrive data is preserved for 30 days which can be increased. If we want to preserve files longer than this, we can either enable retention hold on OneDrive or copy data to another user’s OneDrive.

We can follow below process to Copy OneDrive data.

  • Grant permissions on user’s OneDrive to his manager How to grant permissions ?
  • Generate OneDrive link and provide the link to user
    • Login Microsoft Admin portal
    • Select the user for which you want to save the data
    • Go to OneDrive Tab and click on “Create link to access file”
  • Now user’s manager can copy the data
    • Copy the link and provide to end user to access files of the user leaving
    • Open the link on user’s manager computer and select the folders you want to copy to his OneDrive
  • Click on “Copy To” and the Manager will option to copy to his OneDrive.
  • Select “Your OneDrive”. You will have option to Copy to existing folders or you can create a new folder also.
  • Depending on the size of data, you will start seeing files and folders in your OneDrive.

How to grant a user permission to access another user’s oneDrive

When an employee leaves your organization, the management wants to access their data to review it and give it a new employee or want to backup the data.

Once you remove the license and delete the user, you will have 30 days by default (can be increased from OneDrive admin center) to access user’s OneDrive data, after 30 days the data will be deleted.

We can allows other users to access OneDrive data using below methods.

Option 1 – Using user’s OneDrive link from M365 Admin center

In the admin center, go to the Users > Active users page.
Select a user.
In the right pane, select OneDrive. Under Get access to files, select Create link to files.

Click on this link and you will get redirected to the user’s OneDrive in your browser window.

Replace OneDrive with mngsiteadmin, so the link will become line below.

Add the new user in the permissions list and click Ok. don’t remove any permissions from here.

The new user will have permissions to the OneDrive

Option 2 – Using SharePoint Admin Center.

  • Login SharePoint Admin Center
  • On the left hand pane open the “more features”
  • Under User Profiles, select Open.
  • Under People, select Manage User Profiles.
  • Enter the user’s name and click Find.
  • Right-click on the user’s name and select Manage Site Collection Owners.
  • Add a secondary admin in the “Site Collection Administrators” and Click OK