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
$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
<?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
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
function Connect-ExchangeOnline { | |
<# | |
.Synopsis | |
A function that connects to the Exchange online system. | |
.Parameter Credential | |
A credential object with rights to connect to the Exchange server. This parameter is mandatory. | |
.Parameter AllowClobber | |
Boolean value of whether the imported session will clobber existing commands. Defaults to True. |
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 -Version 3 | |
Function Get-TimezoneFromOffset() | |
{ | |
<# | |
.Synopsis | |
A function that gets the timezones that match a particular offset from UTC | |
.Parameter UTCOffset | |
A string containing offset time you require. This must match the form +NN:NN or -NN:NN. |
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 Get-ComputerADSite() | |
{ | |
<# | |
.Synopsis | |
Get the computers current AD site from the computer Netlogon information. | |
.Example | |
Get-ComputerADSite | |
.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
pushd %~dp0 | |
set _bcu=BiosConfigUtility.exe | |
if /I "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" set _bcu=BiosConfigUtility64.exe | |
"%_bcu%" /nspwdfile:"%~dp0BIOSPW.bin" /set:"%~dp0ProBook6470bConfig.cfg" | |
IF %ERRORLEVEL% NEQ 0 "%_bcu%" /cspwdfile:"%~dp0BIOSPW.bin" /set:"%~dp0ProBook6470bConfig.cfg" | |
popd |
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 Load-Form | |
{ | |
$Form.Controls.Add($TBComputerName) | |
$Form.Controls.Add($GBComputerName) | |
$Form.Controls.Add($ButtonOK) | |
$Form.Add_Shown({$Form.Activate()}) | |
[void] $Form.ShowDialog() | |
} | |
Function Set-OSDComputerName |