This function is part of my AADSites module, which can be downloaded here. For more info on the module see here.
Remove-AADsitelink has to deal with sites still being members of the sitelink.
If you have sites associated to the sitelink, remove-AADsitelink will warn you as such but offer -force:$true as an override
The -confirm:$false switch is availale to supress the confirm prompt.
Remove-AADsitelink has to deal with sites still being members of the sitelink.
If you have sites associated to the sitelink, remove-AADsitelink will warn you as such but offer -force:$true as an override
The -confirm:$false switch is availale to supress the confirm prompt.
NAME
Remove-AADsitelink
SYNOPSIS
Removes the AD sitelink object that matches the name supplied
SYNTAX
Remove-AADsitelink [-Identity][[-force] ] [[-confirm] ] [ ]
DESCRIPTION
Removes the AD sitelink object, if one exists, that matches the name given
If there are sites configured as part of the sitelink, the command
requires -force:$true option to remove the site
Returns True if the the site has been removed, False if not.
PARAMETERS
-Identity
Mandatory - The name of the object you want to remove.
Position 0.
-force
Optional - Set to true if you want to ignore warnings and remove the sitelink
Position 1.
-confirm
Optional - Set to false if you want to remove the sitelink without being prompted
Position 2.
-------------------------- EXAMPLE 1 --------------------------
Simple usage
PS C:\> remove-AADSitelink -identity Sitelinkname
-------------------------- EXAMPLE 2 --------------------------
Simple usage - remove a sitelink without being prompted to confirm
PS C:\> remove-AADSitelink -identity Sitelinkname -confirm:$false
-------------------------- EXAMPLE 3 --------------------------
Simple usage - force the removal of a sitelink with associated sites
PS C:\> remove-AADSitelink -identity Sitelinkname -force:$true
Comments
Post a Comment