Obtain azure ad group sid using powershell – Microsoft Surface Hub 2 SmCamera User Manual

Page 74

Advertising
background image

1. Launch PowerShell with elevated account privileges (

Run as Administrator

) and

ensure your system is configured to run PowerShell scripts. To learn more, refer to

About Execution Policies

.

2.

Install Azure PowerShell module

.

3. Sign in to your Azure AD tenant.

PowerShell

4. When you're signed in to your tenant, run the following commandlet. It will

prompt you to "Please type the Object ID of your Azure AD Group."

PowerShell

Obtain Azure AD Group SID using PowerShell

Connect-AzureAD

function

Convert-ObjectIdToSid

{

param

([String] $ObjectId)

$d=[UInt32[]]::new(4);
[Buffer]::BlockCopy([Guid]::Parse($ObjectId).ToByteArray(),0,$d,0,16);

"

S-1-12-1-$d"

.Replace(

' '

,

'-'

)

Advertising