This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-LAMailboxHold { | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory = $true, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true)] | |
[string[]] $list | |
) | |
Begin { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-LAcolTest { | |
[CmdletBinding()] | |
Param | |
( | |
) | |
Begin { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory = $false)] | |
[switch] $WithoutInPlaceHold, | |
[Parameter(Mandatory = $true, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true)] | |
[string[]] $list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-LAFolderSize { | |
<# | |
.Synopsis | |
Short description | |
.DESCRIPTION | |
Long description | |
.EXAMPLE | |
Example of how to use this cmdlet | |
.EXAMPLE | |
Another example of how to use this cmdlet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-LAFolderSize { | |
Param( | |
[Parameter( | |
Mandatory = $true, | |
ValueFromPipelineByPropertyName = $true, | |
ValueFromPipeline = $true)] | |
[String]$userprincipalname | |
) | |
Begin { | |
$resultArray = @() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-LAMfaStats { | |
<# | |
.Synopsis | |
Short description | |
.DESCRIPTION | |
Long description | |
.EXAMPLE | |
Example of how to use this cmdlet | |
.EXAMPLE | |
Another example of how to use this cmdlet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$searches = Get-ComplianceSearch | select name, @{n = "SharePoint"; e = {(Get-ComplianceSearch $_.identity).SharePointLocation}} | |
foreach ($row in $searches) { | |
$searchHash = @{} | |
if ($($row.SharePoint)) { | |
foreach ($site in $row.SharePoint) { | |
$searchHash['name'] = $row.name | |
$searchHash['SharePoint'] = $site | |
$resultArray += [psCustomObject]$searchHash | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$searches = Get-ComplianceSearch | select name, @{n = "SharePoint"; e = {(Get-ComplianceSearch $_.identity).SharePointLocation}} | |
foreach ($row in $searches) { | |
$searchHash = @{} | |
if ($($row.SharePoint)) { | |
foreach ($site in $row.SharePoint) { | |
$searchHash['name'] = $row.name | |
$searchHash['SharePoint'] = $site | |
$resultArray += [psCustomObject]$searchHash | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$resultArray = @() | |
$policies = Get-RetentionCompliancePolicy | Select name, guid, comment, type | |
$labels = Get-RetentionComplianceRule | Select Policy, RetentionComplianceAction, RetentionDuration, Priority, mode, ContentMatchQuery, disabled, @{n = "LabelName"; e = {($_.ComplianceTagProperty).split(",")[1]}} | |
$policyHash = @{} | |
foreach ($policy in $policies) { | |
$policyHash[$policy.guid] = $policy | |
} | |
foreach ($label in $labels) { | |
$labelHash = [ordered]@{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$OutFile = ".\365PermissionExport.csv" | |
"DisplayName" + "," + "Alias" + "," + "PrimarySMTP" + "," + "FullAccess" + "," + "SendAs" + "," + "SendonBehalf" | Out-File $OutFile -Force -encoding ascii | |
$Mailboxes = import-csv .\someupns.csv | |
# $Mailboxes = Get-Mailbox -ResultSize:Unlimited | |
ForEach ($Mailbox in $Mailboxes) | |
{ | |
$SendAs = Get-RecipientPermission $Mailbox.PrimarySmtpAddress | ? {$_.AccessRights -match "SendAs" -and $_.Trustee -ne "NT AUTHORITY\SELF"} | % {$_.trustee} | |
$FullAccess = Get-MailboxPermission $Mailbox.PrimarySmtpAddress | ? {$_.AccessRights -eq "FullAccess" -and !$_.IsInherited} | % {$_.User} | |
$sendbehalf=Get-Mailbox $Mailbox.PrimarySmtpAddress | select-object -ExpandProperty GrantSendOnBehalfTo |
OlderNewer