Skip to content

Instantly share code, notes, and snippets.

View M1k3l0ny's full-sized avatar

Miguel González Vigil M1k3l0ny

  • Axpo Group
  • Madrid
  • 06:42 (UTC +02:00)
View GitHub Profile
@SMSAgentSoftware
SMSAgentSoftware / Delete-DeviceRecords.ps1
Last active May 16, 2024 17:02
Deletes device records in AD / AAD / Intune / Autopilot / ConfigMgr. Useful for Autopilot test deployments.
[CmdletBinding(DefaultParameterSetName='All')]
Param
(
[Parameter(ParameterSetName='All',Mandatory=$true,ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
[Parameter(ParameterSetName='Individual',Mandatory=$true,ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
[string[]]$ComputerName,
[Parameter(ParameterSetName='All')]
[switch]$All = $True,
[Parameter(ParameterSetName='Individual')]
[switch]$AD,