![]() ![]() ![]() Create graphical tools using PowerShell with the easy to use GUI designer. This single tool will meet all your scripting needs. PowerShell Studio is the premier editor and tool-making environment for PowerShell. Free Download SAPIEN PowerShell Studio 2023 v5.8.227 (圆4) | 518.4 Mb Read-Host "Are you sure you want to Disable the AAD Account & revoke all Azure Tokens of $DisplayName? Press Any Key to continue or CTRL+C to Cancel" Write-Host "The script find the user: $DisplayName (UPN:$UPN) with the following ObjectID: $UserID" -ForegroundColor Green Write-Log Error -Message "Failed to add $DisplayName ($UserPrincipalName - $MgUserID) to $LicenseGroupName" Write-Log INFO -Message "The script added $DisplayName ($UserPrincipalName - $MgUserID) to $LicenseGroupName" New-MgGroupMember -GroupId $LicenseGroupNameID -DirectoryObjectId $MgUserID Write-Log warning -Message "The script will try to add $DisplayName ($UserPrincipalName - $MgUserID) to $LicenseGroupName" Write-Log INFO -Message "The script found $LicenseGroupName" Write-Log Error -Message "Failed to find the group $LicenseGroupName" ![]() $MgLicenseGroup = Get-MgGroup -Filter "DisplayName eq '$LicenseGroupName'" Write-Log warning -Message "The script will try find the group $LicenseGroupName" Write-Log Error -Message "Failed with Error:$ErrorMessage" Write-Log Error -Message "Failed to run the following CMDLet: $CMDLet" Write-Log Error -Message "Failed to create the user: $DisplayName ($UserName)" Write-Log INFO -Message "The script created the user: $DisplayName ($UserName)" $MgUser = New-MgUser -DisplayName $DisplayName -GivenName $FirstName -Surname $LastName -PasswordProfile $PasswordProfile -AccountEnabled -MailNickName $MailNickName -UserPrincipalName $UserName -UsageLocation $UsageLocation ![]() Write-Log warning -Message "The script will try to create the user: $DisplayName ($UserName)" Write-Log Warning -Message "Please make sure you are connected to MgGraph using the following Scopes, ,, , " $connection = Invoke-RestMethod -Uri $URI -Method POST -Body $body # Construct URI and body needed for authentication # Basics #įind-MgGraphCommand -command $CMDLet | Select -First 1 -ExpandProperty Permissions ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |