Skip to content

Commit

Permalink
Add Get-O365CopilotPin function and example script for retrieving Cop…
Browse files Browse the repository at this point in the history
…ilot PIN
  • Loading branch information
PrzemyslawKlys committed Dec 17, 2024
1 parent cb9cac6 commit 9228d6b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Examples/GetO365CopilotPin.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Import-Module .\O365Essentials.psd1 -Force

# This makes a connection to Office 365 tenant
# since we don't want to save the data we null it out
# keep in mind that if there's an MFA you would be better left without Credentials and just let it prompt you
$null = Connect-O365Admin -Verbose

Get-O365CopilotPin -Verbose
9 changes: 9 additions & 0 deletions Public/Get-O365CopilotPin.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Get-O365CopilotPin {
[cmdletbinding()]
param(
[alias('Authorization')][System.Collections.IDictionary] $Headers
)
$Uri = "https://admin.microsoft.com/admin/api/settings/company/copilotpolicy/pin"
$OutputSettings = Invoke-O365Admin -Uri $Uri -Headers $Headers -Method GET
$OutputSettings
}

0 comments on commit 9228d6b

Please sign in to comment.