Home › Studies › SC-300 › CLI & PowerShell Commands

CLI & PowerShell Commands

SC-300 tasks with the Azure CLI and PowerShell side by side for each domain, copied from the topic pages.

Every command here comes from a CLI or PowerShell table on one of the SC-300 topic pages. A - means the topic page gives no command for that tool. Placeholders such as <rg> are yours to fill in.

Implement and manage user identities (20–25%)

Tenant, Roles & Admin Units

TaskAzure CLIPowerShell
Sign in to Graph to assign or manage Entra roles-Connect-MgGraph -Scopes "RoleManagement.ReadWrite.Directory"
Get a built-in role definition-$roleDefinition = Get-MgRoleManagementDirectoryRoleDefinition -Filter "displayName eq 'Billing Administrator'"
Sign in to Graph to manage administrative units-Connect-MgGraph -Scopes "AdministrativeUnit.ReadWrite.All"
Create an administrative unit-$adminUnitObj = New-MgDirectoryAdministrativeUnit -BodyParameter $params
Install the Microsoft Graph PowerShell module-Install-Module Microsoft.Graph -Scope CurrentUser

Users, Groups, Devices & Licenses

TaskAzure CLIPowerShell
List member users-Get-MgUser -Filter "UserType eq 'Member'"
Assign licences to a group-Set-MgGroupLicense -GroupId $groupId -BodyParameter $params
List groups that have licences-Get-MgGroup -All -Property Id, MailNickname, DisplayName, GroupTypes, Description, AssignedLicenses | Where-Object {$_.AssignedLicenses -ne $null }
Sign in to assign custom security attributes-Connect-MgGraph -Scopes "CustomSecAttributeAssignment.ReadWrite.All"
List attribute sets-Get-MgDirectoryAttributeSet

External & Cross-Tenant Access

TaskAzure CLIPowerShell
Connect to the tenant before bulk invitations-Connect-MgGraph -TenantId "<YOUR_TENANT_ID>"
List guest users (verify invitations)-Get-MgUser -Filter "UserType eq 'Guest'"
Send an invitation (used in a loop over the CSV)-New-MgInvitation

Hybrid Identity & Entra Connect

TaskAzure CLIPowerShell
Show scheduler configuration-Get-ADSyncScheduler
Disable the sync scheduler-Set-ADSyncScheduler -SyncCycleEnabled $false
Run a delta sync cycle-Start-ADSyncSyncCycle -PolicyType Delta
Run a full sync cycle-Start-ADSyncSyncCycle -PolicyType Initial
Document current federation settings-Get-MgDomainFederationConfiguration -DomainID contoso.com
Convert a domain from federated to managed-Update-MgDomain -DomainId <domain name> -AuthenticationType "Managed"

Topic pages: Tenant, Roles & Admin Units, Users, Groups, Devices & Licenses, External & Cross-Tenant Access, Hybrid Identity & Entra Connect.

Implement authentication and access management (20–25%)

Authentication Methods, MFA & SSPR

TaskAzure CLIPowerShell
Create a Temporary Access Pass-New-MgUserAuthenticationTemporaryAccessPassMethod -UserId user2@contoso.com -BodyParameter $propertiesJSON
Get a user's Temporary Access Pass-Get-MgUserAuthenticationTemporaryAccessPassMethod -UserId user3@contoso.com
Remove a Temporary Access Pass-Remove-MgUserAuthenticationTemporaryAccessPassMethod -UserId user3@contoso.com -TemporaryAccessPassAuthenticationMethodId 00aa00aa-bb11-cc22-dd33-44ee44ee44ee
Disable a user account-Update-MgUser -UserId $User.Id -AccountEnabled:$false
Revoke a user's refresh tokens-Revoke-MgUserSignInSession -UserId $User.Id
Turn off SSPR for administrators-Update-MgPolicyAuthorizationPolicy -AllowedToUseSspr:$false
Create the Entra Kerberos server object-Set-AzureADKerberosServer -Domain $domain -CloudCredential $cloudCred -DomainCredential $domainCred
Rotate the Entra Kerberos server key-Set-AzureADKerberosServer -Domain $domain -CloudCredential $cloudCred -DomainCredential $domainCred -RotateServerKey

Global Secure Access

TaskAzure CLIPowerShell
Install the Global Secure Access client on macOS silentlysudo installer -pkg ~/Downloads/GlobalSecureAccessClient.pkg -target / -verboseR-
Uninstall the Windows client (Intune uninstall command)-"GlobalSecureAccessClient.exe" /uninstall /quiet /norestart

Topic pages: Authentication Methods, MFA & SSPR, Global Secure Access.

Plan and implement workload identities (20–25%)

Managed Identities

TaskAzure CLIPowerShell
Create a user-assigned managed identityaz identity create -g myResourceGroup -n myUserAssignedIdentityNew-AzUserAssignedIdentity -ResourceGroupName <RESOURCEGROUP> -Name <USER ASSIGNED IDENTITY NAME>
Enable system-assigned identity on an existing VMaz vm identity assign -g myResourceGroup -n myVmUpdate-AzVM -ResourceGroupName myResourceGroup -VM $vm -IdentityType SystemAssigned
Assign a user-assigned identity to a VMaz vm identity assign -g <RESOURCE GROUP> -n <VM NAME> --identities <USER ASSIGNED IDENTITY>Update-AzVM -ResourceGroupName <RESOURCE GROUP> -VM $vm -IdentityType UserAssigned -IdentityID $uid
Remove a user-assigned identity from a VMaz vm identity remove -g <RESOURCE GROUP> -n <VM NAME> --identities <USER ASSIGNED IDENTITY>-
List a tenant's managed identity permissions (app roles)-Get-MgServicePrincipalAppRoleAssignment -ServicePrincipalId <String>

Enterprise Apps & Consent

TaskAzure CLIPowerShell
Assign a user to an app role-New-MgUserAppRoleAssignment -UserId $userId -BodyParameter $params
Assign a group to an app role-New-MgGroupAppRoleAssignment
Find the service principal for an appaz ad sp list --filter "appId eq '{AppId}'"Get-MgServicePrincipal -Filter "appId eq '{AppId}'"
Add an owner to an enterprise app-New-MgServicePrincipalOwnerByRef -ServicePrincipalId 'aaaaaaaa-bbbb-cccc-1111-222222222222' -BodyParameter $params

App Registrations

TaskAzure CLIPowerShell
List service principals for an appaz ad sp list --filter "appId eq '{AppId}'"Get-MgServicePrincipal -Filter "appId eq '{AppId}'"

Defender for Cloud Apps

TaskAzure CLIPowerShell
Create the service principal for Microsoft Defender for Cloud Apps - Session Controls (after Connect-MgGraph -Scopes "Application.ReadWrite.All")-New-MgServicePrincipal -AppId 8a0c2593-9cbc-4f86-a247-beb7aab00d83

Topic pages: Managed Identities, Enterprise Apps & Consent, App Registrations, Defender for Cloud Apps.

Plan and automate identity governance (20–25%)

Entitlement Management

TaskAzure CLIPowerShell
Create a catalog-New-MgEntitlementManagementCatalog -DisplayName "Marketing"
List connected organizations-Get-MgEntitlementManagementConnectedOrganization -all

Access Reviews

TaskAzure CLIPowerShell
Create an access review definition-New-MgIdentityGovernanceAccessReviewDefinition
Get decisions of a review instance-Get-MgIdentityGovernanceAccessReviewDefinitionInstanceDecision

Topic pages: Entitlement Management, Access Reviews.

Pages with no command table

These topic pages have no CLI or PowerShell table, so nothing from them is repeated here: Conditional Access, ID Protection & Risk, Privileged Identity Management, Logs, Workbooks & Secure Score.