Skip to content

Instantly share code, notes, and snippets.

View M1k3l0ny's full-sized avatar

Miguel González Vigil M1k3l0ny

  • Axpo Group
  • Madrid
  • 22:57 (UTC +01:00)
View GitHub Profile
@SMSAgentSoftware
SMSAgentSoftware / Delete-DeviceRecords.ps1
Last active October 23, 2024 11:56
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,