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
# ############################### | |
# Get-ChildItem-Path.Tests.ps1 | |
# https://blog.neilsabol.site/post/deleting-specific-log-files-by-extension-older-than-days/ | |
# Neil Sabol | |
# [email protected] | |
# ############################### | |
# Define test parameters | |
$script:testPath = "C:\Temp" | |
$script:testLiteralPath = "\\?\C:\Temp" |
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
# Specify the FQDNs of the source and destination distribution points | |
$sourceDP = "MEMCMDP1.contoso.com" | |
$destDP = "MEMCMDP2.contoso.com" | |
# Suppress error messages (usually because content already exists on the destination) | |
$ErrorActionPreference = "SilentlyContinue" | |
# Get all content from the source DP | |
# See https://learn.microsoft.com/en-us/powershell/module/configurationmanager/get-cmdeploymentpackage?view=sccm-ps | |
Get-CMDeploymentPackage -DistributionPointName $sourceDP | %{ |
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
# Install the PowerShell LDAP module | |
Install-Module -Name Ldap | |
# Create an Active Directory connection via LDAP, replacing 'CN=binduser,OU=Accounts,DC=ad,DC=contoso,DC=com' | |
# with a real user in the directory and specifying the user's password when prompted | |
# See https://github.com/replicaJunction/Ldap/blob/master/docs/en-US/Get-LdapConnection.md | |
$binduser = 'CN=binduser,OU=Accounts,DC=ad,DC=contoso,DC=com' | |
$connection = Get-LdapConnection -Server 'ad.contoso.com' -Port 636 -Credential (New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $binduser,(Read-Host -AsSecureString -Prompt "Enter password")) | |
# Specify a large AD group and search base to query |
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 parse-m365-auditlogsearch-results { | |
# Collect the input and output files | |
Param ( | |
[Parameter(Mandatory=$true)] | |
[string] $auditlogsearchresultfile = "", | |
[Parameter(Mandatory=$true)] | |
[string] $outputcsvfilepath = "" | |
) | |
# Import the Audit Log Search Result CSV file exported from Microsoft Purview |
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
<# | |
Modified version of mrik23's MSOL-BulkRemoveDirectAssignedLicense.ps1 (https://gist.github.com/mrik23/2ed37ce0c7c4a79605bdcf052e29b391) | |
MSOL-BulkRemoveDirectAssignedLicense.ps1 was a modified version of a script from Microsoft Documentation. | |
Ref: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-licensing-ps-examples | |
Removed the part that checks if the users is assigned more products than the group assigned license. | |
Added connection part and help to find Sku and Group Object ID. | |
This script requires the Microsoft Graph (MgGraph) PowerShell module. | |
#> | |
Import-Module Microsoft.Graph.Users |
OlderNewer