This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
Get-CsAdUser -ResultSize Unlimited | Where-Object {$_.UserAccountControl -match "AccountDisabled" -and $_.Enabled} | Disable-CsUser |
This file contains hidden or 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
Import-Module ActiveDirectory $InternalADUsers = Get-ADGroupMember -Identity Internal | select-object -ExpandProperty SamAccountName #foreach {$_.SamAcountName} Foreach ($I in $InternalADUsers) { $SignaturesPath = "S:\Signatures\$I" write-host "$SiganturesPath" #if(Test-Path = $SignaturesPath) # { # Write-Host "$SignaturePath exists" # } } |
This file contains hidden or 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 ConnectTo-ExchangePS { | |
<# | |
.SYNOPSIS | |
Gathers information about exchange to automatically run the correct Exchange PS | |
.DESCRIPTION | |
Imports exchange modules and connects to the exchange server, this allows exchange PS scripts | |
to be run directly from a standard powershell window. | |
.NOTES |
This file contains hidden or 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
$qtVer = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | | |
Get-ItemProperty | | |
Where-Object {$_.DisplayName -match "quicktime" } | | |
Select-Object -Property DisplayName, UninstallString | |
ForEach ($ver in $qtVer) { | |
If ($ver.UninstallString) { | |
$uninst = $ver.UninstallString |
This file contains hidden or 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
Get-Process $processname | select -ExpandProperty modules| Format-Table -Wrap -AutoSize -property company, filename| out-string -width 1024 |
This file contains hidden or 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
@REM specify ID at time of execution: deploy.bat ### (### = the actual client ID number) | |
if %1%=="0" GOTO END | |
IF NOT EXIST C:\WINDOWS\LTSVC GOTO Install | |
GOTO END | |
:Install | |
SET ID=%1% | |
IF "%ID%"=="" SET /P ID="What is the Site ID: " | |
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://lt1.arrc.com/Labtech/Deployment.aspx?Probe=1&ID=%ID%', '%TEMP%\Agent_Install.exe')" | |
%TEMP%\Agent_Install.exe /s |
This file contains hidden or 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
SELECT clients.name AS 'ClientName',comp.name AS 'ComputerName', COUNT(H.installed) AS '# Patches Missing',comp.lastcontact AS 'Last Checked In' | |
FROM hotfix AS H, computers AS comp, clients | |
WHERE H.installed=0 | |
AND H.approved=1 | |
AND comp.computerid=H.computerid | |
AND comp.clientid=clients.clientid | |
AND comp.clientid=220 | |
GROUP BY comp.name | |
ORDER BY comp.lastcontact DESC |
This file contains hidden or 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
SELECT `computers`.`name` AS 'PC Name', | |
`computers`.`ComputerID` AS 'Agent ID', | |
`computers`.`OS` AS 'OS', | |
`computers`.`LastContact` AS 'Last Contact', | |
COUNT(hotfixid) AS 'Updates Pending' | |
FROM `hotfix` | |
JOIN `computers`ON ( `hotfix`.`ComputerID` = `computers`.`ComputerID` ) | |
JOIN clients ON (computers.clientid=clients.clientid) | |
WHERE `hotfix`.`Installed`=0 AND `hotfix`.`Approved`=1 | |
AND clients.clientid NOT IN (33) |
This file contains hidden or 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
SELECT cmd.`ComputerID` AS 'ID', | |
cl.name AS 'Client', | |
c.name AS 'Hostname', | |
c.OS AS 'OS', | |
cmd.DateUpdated AS 'Start Time', | |
(LENGTH (cmd.parameters) - LENGTH(REPLACE(cmd.parameters,',','')))+1 AS 'Patches Installing', | |
(ROUND(TIME_TO_SEC(TIMEDIFF(NOW(),cmd.DateUpdated))/60)-1) AS 'Elapsed Time (m)' | |
FROM commands cmd | |
JOIN computers c ON (c.computerid = cmd.computerid) | |
JOIN clients cl ON (cl.clientid = c.clientid) |
OlderNewer