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
Set objArgs = Wscript.Arguments | |
Set oAPI = CreateObject("MOM.ScriptAPI") | |
Set oBag = oAPI.CreatePropertyBag() | |
Set objConnection = CreateObject("ADODB.Connection") | |
Set objRecordSet = CreateObject("ADODB.Recordset") | |
Dim ConnString | |
ConnString = "DRIVER={SQL Server};Server=" & objArgs(0) & ";Database=" & objArgs(1) & ";" | |
objConnection.Open ConnString | |
objRecordSet.Open "SELECT TOP(1) CC.CollectionID, CN.CollectionName, CC.TimeUpdated FROM Collection_MemberChg_Notif CC JOIN Collections CN ON CC.CollectionID = CN.SiteID WHERE CN.CollectionName = 'Test Collection' AND CC.TimeUpdated < DATEADD(mi, -20, GETDATE())", objConnection, 3, 3 |
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
<?xml version="1.0" encoding="utf-8"?><ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<Manifest> | |
<Identity> | |
<ID>Custom.SQLQueries</ID> | |
<Version>1.0.0.1</Version> | |
</Identity> | |
<Name>Custom - SQLQueries</Name> | |
<References> | |
<Reference Alias="MicrosoftWindowsLibrary7585010"> | |
<ID>Microsoft.Windows.Library</ID> |
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
$API = New-Object -ComObject "MOM.ScriptAPI" -ErrorAction Stop | |
$PropertyBag = $API.CreatePropertyBag() | |
$Profiles = @{'Domain' = '0'; 'Standard' = '0'; 'Public' = '0'} | |
$Profiles.Domain = (Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile' -Name EnableFirewall).EnableFirewall | |
$Profiles.Standard = (Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile' -Name EnableFirewall).EnableFirewall | |
$Profiles.Public = (Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile' -Name EnableFirewall).EnableFirewall | |
if ($Profiles.Values -contains 0) | |
{ |
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
$API = New-Object -ComObject "MOM.ScriptAPI" -ErrorAction Stop | |
$PropertyBag = $API.CreatePropertyBag() | |
$Profiles = @{'Admin' = 0; 'User' = 0} | |
$Profiles.Admin = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}' -Name IsInstalled).IsInstalled | |
$Profiles.User = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}' -Name IsInstalled).IsInstalled | |
if ($Profiles.Values -contains 0) | |
{ | |
$PropertyBag.AddValue('State', 1) |
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 Build-CustomWIMImage | |
{ | |
[CmdletBinding(SupportsShouldProcess)] | |
Param( | |
[parameter(Mandatory=$true, Position=1)][ValidateScript({ Test-Path $_ })][string]$ImagePath, | |
[parameter()][ValidateScript({ Test-Path $_ })][string]$UpdatesPath, | |
[parameter()][ValidateNotNullOrEmpty()][string[]]$RemoveAppxPackages = { | |
'Microsoft.3DBuilder', | |
'Microsoft.BingFinance', | |
'Microsoft.BingNews', |
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 Test-MsolConnection { | |
<# | |
.Synopsis | |
A function that tests the Microsoft Online connection. | |
.Example | |
Test-MsolConnection | |
Tests to see if the Microsoft Online connection is available. |
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 Set-IdentityManagementGalAdPermission { | |
<# | |
.Synopsis | |
A function that sets the permissions in Active Directory (AD) required for Microsoft Identity Manager (MIM) to perform Global Address List (GAL) sync operations. | |
.Description | |
This function sets the AD permissions required for MIM to perform GALSync operations. It does this by adding the required new permissions for the GALSync group to at least three places in the AD. | |
The GALSync group requires permissions to AD for the following: |
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 DHCPServer | |
Function Get-UnmatchedDhcpServerv4Reservation { | |
<# | |
.Synopsis | |
A function gets DHCP IPv4 reservations from a single scope stretched over two DHCP servers. | |
.Description | |
A function gets DHCP IPv4 reservations from a single scope stretched over two DHCP servers |
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
PUSHD %~dp0 | |
SET _bcu=BiosConfigUtility.exe | |
SET config=%1 | |
IF /I "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" ( | |
SET _bcu=BiosConfigUtility64.exe | |
) | |
"%_bcu%" /nspwdfile:"%~dp0BIOSPW.bin" /set:"%~dp0%config%" /l |
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
PUSHD %~dp0 | |
SET _upd=HPBIOSUPDREC.exe | |
SET bios=%1 | |
IF /I "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" ( | |
SET _upd=HPBIOSUPDREC64.exe | |
) | |
"%_upd%" -pBIOSPW.bin -f%bios% -s -r |