You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Making sure we can have those fancy messageboxes working...
47
+
Add-Type-AssemblyName PresentationFramework
48
+
49
+
#Check for running as administrator, if not: exit
50
+
Write-Host"Checking for elevated permissions..."
51
+
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
52
+
{
53
+
[System.Windows.MessageBox]::Show("Insufficient permissions to run this script. Open the PowerShell console as an administrator and run this script again.","Error","OK","Error")
54
+
exit1
55
+
}
56
+
else
57
+
{
58
+
Write-Host"Code is running as administrator — go on executing the script..."-ForegroundColor Green
59
+
}
60
+
61
+
#Initialize variables
62
+
$SelectedDomain=""
63
+
$ADGroup=""
64
+
$Subgroupname=""
65
+
$ToCleanGroup=""
66
+
$CSVFile="c:\temp\DisabledAccountsCleaned.csv"
67
+
$csvContents=@() # Create the empty array that will eventually be the CSV file
68
+
69
+
#Get the AD DomainName
70
+
$ADForestInfo=Get-ADForest
71
+
$SelectedDomain=$ADForestInfo.Domains|Out-GridView-Title "Select AD Domain"-OutputMode Single
72
+
73
+
#Check for a valid DomainName
74
+
if ($SelectedDomain-eq$null)
75
+
{
76
+
[System.Windows.MessageBox]::Show("AD Domain not selected","Error","OK","Error")
Copy AD group members from one AD group to another AD group in the same domain
5
+
.DESCRIPTION
6
+
This script provides a GUI to quickly copy AD group members to another existing group in the same domain. Multi-domain forests are supported, the script will query for the AD domain.
7
+
.PARAMETER<Parameter_Name>
8
+
None
9
+
.INPUTS
10
+
AD Domain, Source AD group, Destination AD Group
11
+
.OUTPUTS
12
+
None
13
+
.NOTES
14
+
Version: 1.1
15
+
Author: Bart Jacobs - @Cloudsparkle
16
+
Creation Date: 09/03/2020
17
+
Purpose/Change: Copy AD Group members to another group
18
+
19
+
.EXAMPLE
20
+
None
21
+
#>
22
+
23
+
#Initialize variables
24
+
$SelectedDomain=""
25
+
$SourceGroup=""
26
+
$DestinationGroup=""
27
+
28
+
Add-Type-AssemblyName PresentationFramework
29
+
30
+
#Get the AD DomainName
31
+
$ADForestInfo=Get-ADForest
32
+
$SelectedDomain=$ADForestInfo.Domains|Out-GridView-Title "Select AD Domain"-OutputMode Single
33
+
34
+
#Check for a valid DomainName
35
+
if ($SelectedDomain-eq$null)
36
+
{
37
+
[System.Windows.MessageBox]::Show("AD Domain not selected","Error","OK","Error")
Clean up (partial) local profiles that are not in use anymore.
8
+
.DESCRIPTION
9
+
This script provides a way to delete local (copies) of user profiles that are not in use anymore. There is an option to exclude specified accounts. Special accounts like SYSTEM are always excluded
10
+
.PARAMETERRunOnce
11
+
By default, the script will loop continuously, use this parameter to run it only once
0 commit comments