Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AndroidEnterprise/Get-AndroidDedicatedDeviceProfiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ $Resource = "deviceManagement/androidDeviceOwnerEnrollmentProfiles"

$now = (Get-Date -Format s)
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)?`$filter=tokenExpirationDateTime gt $($now)z"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value

}

Expand Down
4 changes: 2 additions & 2 deletions AndroidEnterprise/Get-AndroidDedicatedDeviceQRCode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ $Resource = "deviceManagement/androidDeviceOwnerEnrollmentProfiles"

$now = (Get-Date -Format s)
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)?`$filter=tokenExpirationDateTime gt $($now)z"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value

}

Expand Down Expand Up @@ -218,7 +218,7 @@ $graphApiVersion = "Beta"

$Resource = "deviceManagement/androidDeviceOwnerEnrollmentProfiles/$($Profileid)?`$select=qrCodeImage"
$uri = "https://graph.microsoft.com/$graphApiVersion/$Resource"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get)
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get)

}

Expand Down
10 changes: 5 additions & 5 deletions AndroidEnterprise/Get-AndroidWorkProfileConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ $Group_resource = "groups"
if($id){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=id eq '$id'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($GroupName -eq "" -or $GroupName -eq $null){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand All @@ -241,21 +241,21 @@ $Group_resource = "groups"
if(!$Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
$Group = (Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
$Group = (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

if($Group){

$GID = $Group.id

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)/$GID/Members"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand Down
10 changes: 5 additions & 5 deletions AppProtectionPolicy/ManagedAppPolicy_WIP_Add_Assign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -507,14 +507,14 @@ $Group_resource = "groups"
if($id){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=id eq '$id'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($GroupName -eq "" -or $GroupName -eq $null){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand All @@ -523,14 +523,14 @@ $Group_resource = "groups"
if(!$Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
$Group = (Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
$Group = (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

if($Group){

Expand All @@ -540,7 +540,7 @@ $Group_resource = "groups"
write-host

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)/$GID/Members"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand Down
6 changes: 3 additions & 3 deletions AppleEnrollment/AppleDEPProfile_Assign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ Param(

$Resource = "deviceManagement/depOnboardingSettings/$tokenid/"
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get)
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get)

}

else {

$Resource = "deviceManagement/depOnboardingSettings/"
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value

}

Expand Down Expand Up @@ -501,7 +501,7 @@ $graphApiVersion = "beta"
$Resource = "deviceManagement/depOnboardingSettings/$($id)/importedAppleDeviceIdentities?`$filter=discoverySource eq 'deviceEnrollmentProgram' and contains(serialNumber,'$DeviceSerialNumber')"

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
$SearchResult = (Invoke-RestMethod -Uri $uri Headers $authToken Method Get).value
$SearchResult = (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value

if (!($SearchResult)){

Expand Down
4 changes: 2 additions & 2 deletions AppleEnrollment/AppleDEP_Sync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ $graphApiVersion = "beta"

$Resource = "deviceManagement/depOnboardingSettings/$tokenid/"
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get)
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get)

}

else {

$Resource = "deviceManagement/depOnboardingSettings/"
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value

}

Expand Down
2 changes: 1 addition & 1 deletion ApplicationSync/AppleVPP_Sync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ $Resource = "deviceAppManagement/vppTokens"
try {

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value

}

Expand Down
14 changes: 7 additions & 7 deletions Applications/Application_Get_Assign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ $Resource = "deviceAppManagement/mobileApps"
try {

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value | ? { (!($_.'@odata.type').Contains("managed")) }
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value | ? { (!($_.'@odata.type').Contains("managed")) }

}

Expand Down Expand Up @@ -231,7 +231,7 @@ $Resource = "deviceAppManagement/mobileApps/$ApplicationId/?`$expand=categories,
else {

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get)
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get)

}

Expand Down Expand Up @@ -470,14 +470,14 @@ $Group_resource = "groups"
if($id){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=id eq '$id'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($GroupName -eq "" -or $GroupName -eq $null){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand All @@ -486,14 +486,14 @@ $Group_resource = "groups"
if(!$Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
$Group = (Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
$Group = (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

if($Group){

Expand All @@ -503,7 +503,7 @@ $Group_resource = "groups"
write-host

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)/$GID/Members"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand Down
10 changes: 5 additions & 5 deletions Applications/Application_MacOSOffice365_Add_Assign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,14 @@ $Group_resource = "groups"
if($id){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=id eq '$id'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($GroupName -eq "" -or $GroupName -eq $null){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand All @@ -392,14 +392,14 @@ $Group_resource = "groups"
if(!$Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
$Group = (Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
$Group = (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

if($Group){

Expand All @@ -409,7 +409,7 @@ $Group_resource = "groups"
write-host

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)/$GID/Members"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand Down
10 changes: 5 additions & 5 deletions Applications/Application_Office365_Add_Assign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,14 @@ $Group_resource = "groups"
if($id){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=id eq '$id'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($GroupName -eq "" -or $GroupName -eq $null){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand All @@ -392,14 +392,14 @@ $Group_resource = "groups"
if(!$Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

elseif($Members){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)?`$filter=displayname eq '$GroupName'"
$Group = (Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
$Group = (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

if($Group){

Expand All @@ -409,7 +409,7 @@ $Group_resource = "groups"
write-host

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Group_resource)/$GID/Members"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand Down
6 changes: 3 additions & 3 deletions Auditing/Auditing_User_Report_Get.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ $User_resource = "users"
if($userPrincipalName -eq "" -or $userPrincipalName -eq $null){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($User_resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand All @@ -193,15 +193,15 @@ $User_resource = "users"

$uri = "https://graph.microsoft.com/$graphApiVersion/$($User_resource)/$userPrincipalName"
Write-Verbose $uri
Invoke-RestMethod -Uri $uri Headers $authToken Method Get
Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get

}

else {

$uri = "https://graph.microsoft.com/$graphApiVersion/$($User_resource)/$userPrincipalName/$Property"
Write-Verbose $uri
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value

}

Expand Down
8 changes: 4 additions & 4 deletions RBAC/RBAC_ScopeTags_ApplicationAssign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -242,21 +242,21 @@ $Resource = "deviceAppManagement/mobileApps"
if($displayName){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)?`$filter=displayName eq '$displayName'"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).value
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value

}

elseif($id){

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)/$id"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get)
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get)

}

else {

$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri Headers $authToken Method Get).Value | ? { (!($_.'@odata.type').Contains("managed")) }
(Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value | ? { (!($_.'@odata.type').Contains("managed")) }

}
}
Expand Down Expand Up @@ -331,7 +331,7 @@ $JSON = @"

else {

$object = New-Object TypeName PSObject
$object = New-Object -TypeName PSObject
$object | Add-Member -MemberType NoteProperty -Name '@odata.type' -Value "$Type"
$object | Add-Member -MemberType NoteProperty -Name 'roleScopeTagIds' -Value @($ScopeTags)
$JSON = $object | ConvertTo-Json
Expand Down
Loading