quinta-feira, fevereiro 11, 2021

Active Directory to Azure AD

 Environment:

- Local Active directory with Azure Ad Connect 

- An Azure AD 

In this lab\env I don't have Exchange in Hybrid mode.

The first step is create an OU and not sync, in my case the OU is UnsyncUser

 

- Move the user to UnsyncUser


- Sync the Ad Connect:

> Start-ADSyncSyncCycle -PolicyType Delta 

Connect to Azure:

>Connect-MsolService

 

Get deleted users:

>Get-MsolUser -ReturnDeletedUsers 

Restore a User:

>Restore-MsolUser -UserPrincipalName bill@maykonrds.site 

 

If you take a look now the users is a Cloud

Another way to do that is disable the Sync:

>Set-MsolDirSyncEnabled -EnableDirSync $false

It may take 72 hours for deactivation to be completed.

Check the status, need to be false.

>(Get-MSOLCompanyInformation).DirectorySynchronizationEnabled

If you do that all users\groups will be in the Cloud.

quinta-feira, janeiro 28, 2021

Script to follow a Sharepoint Site

The script is available on GitHub:

https://github.com/maykonrds/powershell/blob/master/SharePoint/SharePoint-Follow.ps1

The script is very simple, but before running it is necessary to create an App register in Azure AD, after that it is necessary to configure the permissions for the App to access the Microsoft Graph API: