This file contains 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
param( | |
[String]$DomainDN = 'dc=ad,dc=contoso,dc=com', | |
[String]$LocalBackupPath = 'C:\Windows\System32\dhcp\backup', | |
[String]$RemoteBackupPath = '\\fileserver\share\Backups\DHCP', | |
[Int32]$BackupDaysToRetain = 30 | |
) | |
begin{ |
This file contains 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
<# | |
.SYNOPSIS | |
Backs up Cisco UCS Manager as a scheduled task | |
.DESCRIPTION | |
All available UCS Manager backup types will be taken and compressed (ZIP) then stored in the specified location | |
.OUTPUTS | |
None. Progress is displayed via Write-Host when running the script manually, but there is no output returned. | |
.EXAMPLE | |
.\Backup-CiscoUcs.ps1 -PsSessionXml 'C:\PsSessionInfo.xml' -DecryptionKey 'PlaintextPrivateKeyGoesHere' -BackupLocation 'C:\Backups' | |
.NOTES |
This file contains 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
<# | |
.SYNOPSIS | |
Copy group memberships from a source user to a target user in Active Directory | |
.DESCRIPTION | |
The target user will be added to all groups the source user is a member of. | |
Existing group memberships of the target user will NOT be removed. | |
.PARAMETER SourceUser | |
The source user whose memberships are to be copied | |
.PARAMETER TargetUser | |
The target user to be added to the groups |
This file contains 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 Copy-File { | |
param( | |
#Path to the source file | |
[Parameter( | |
Mandatory = $True, | |
Position = 0 | |
)] | |
[String]$SourceFilePath, |
This file contains 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 ConvertTo-ExchangeRole{ | |
<# | |
.SYNOPSIS | |
Convert the msExchCurrentServerRoles AD attribute into the Exchange Roles it represents | |
.DESCRIPTION | |
Performs a bitwise And comparison against a provided integer and the keys from a hard-coded dictionary | |
Dictionary based on a table from a TechNet article | |
https://technet.microsoft.com/en-us/library/bb123496(EXCHG.80).aspx | |
.PARAMETER Roles | |
Integer representing the Exchange roles held by the server. Matches the msExchCurrentServerRoles AD attribute. |
This file contains 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
On Error Resume Next | |
strOldHostname = InputBox ("Enter the hostname to be removed from DNS. Just the hostname, please; not the FQDN.","Enter the host name to be removed","") | |
'Track when the script began | |
StartTime = Now | |
'Begin the log file | |
Set objShell = CreateObject("WScript.Shell") | |
strLocalAppDataPath = objShell.ExpandEnvironmentStrings("%LocalAppData%") |
This file contains 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
<# | |
.SYNOPSIS | |
Add all members of a source group to a target group in Active Directory. | |
.DESCRIPTION | |
Members of the source group will be added to the target group if not already members | |
Existing members of the target group will not be modified. | |
.OUTPUTS | |
Results are written to the console. | |
.EXAMPLE | |
.\Copy-GroupMembers.ps1 |
This file contains 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
param ( | |
# Name of the group whose members to retrieve | |
[string]$GroupName | |
) | |
function Search-Directory { | |
# Uses the .NET System.DirectoryServices Namespace to perform an LDAP search | |
param ( |
This file contains 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
declare @COLLID AS nvarchar(8) = 'ABC12345' | |
declare @Today DateTime = GetDate() | |
declare @30DaysBeforeToday DateTime = DateAdd("d",-30,GetDate()) | |
declare @31DaysBeforeToday DateTime = DateAdd("d",-31,GetDate()) | |
declare @60DaysBeforeToday DateTime = DateAdd("d",-60,GetDate()) | |
declare @61DaysBeforeToday DateTime = DateAdd("d",-61,GetDate()) | |
declare @90DaysBeforeToday DateTime = DateAdd("d",-90,GetDate()) | |
declare @91DaysBeforeToday DateTime = DateAdd("d",-91,GetDate()) | |
declare @10YearsAgo DateTime = DateAdd("d",-3650,GetDate()) |
This file contains 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
# Requires -Module virtualmachinemanager | |
using namespace Windows.Storage | |
using namespace Windows.Graphics.Imaging | |
using namespace System.Runtime.WindowsRuntime | |
param ( | |
[string]$VMMServer, | |
[string]$OutputDir = 'C:\ProgramData\Get-SCVMConsoleOCR' | |
) |
OlderNewer