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"?> | |
<functions> | |
<ActiveDirectory> | |
<FGPP> | |
<function name="Validate-IsFgppLinkedToAdminGroup" status="enabled" description="" description="" severity="1" category="BestPractice" /> | |
<function name="Validate-IsFgppLinkedToNonGlobalGroup" status="enabled" description="" severity="1" category="BestPractice" /> | |
</FGPP> | |
<GPO> | |
</GPO> | |
<LDAP> |
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"?> | |
<functions> | |
<ActiveDirectory> | |
<FGPP> | |
<function name="Validate-IsFgppLinkedToAdminGroup" status="enabled" description="" description="" severity="1" category="BestPractice" /> | |
<function name="Validate-IsFgppLinkedToNonGlobalGroup" status="enabled" description="" severity="1" category="BestPractice" /> | |
</FGPP> | |
<GPO> | |
</GPO> | |
<LDAP> |
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 4 | |
<# | |
.NOTES | |
Created on: 10/8/2014 | |
Created by: Adam Bertram | |
Filename: Start-ModPollMonitor.ps1 | |
Requirements: Share permissions for Everyone on destination share | |
The source computer account Modify NTFS rights on destination folder | |
.DESCRIPTION |
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 Convert-TimeStringToTimeSpan($TimeString) { | |
$AllowedLabels = (New-TimeSpan).Psobject.Properties.Name | |
## Add the singular values as well | |
$AllowedLabels += $AllowedLabels | foreach { $_.TrimEnd('s') } | |
## Strip the 'for' string | |
$TimeString = $TimeString.TrimStart('for ') | |
## Attempt to split on the 'and' string in case it was something like 1 hour and 15 minutes | |
$Values = $TimeString -split ' and ' | |
$Hours = 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
function Get-LoggedOnUserSID { | |
<# | |
.SYNOPSIS | |
This function queries the registry to find the SID of the user that's currently logged onto the computer interactively. | |
#> | |
[CmdletBinding()] | |
param () | |
process { | |
try { | |
New-PSDrive -Name HKU -PSProvider Registry -Root Registry::HKEY_USERS | Out-Null |
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-InstalledSoftware { | |
<# | |
.SYNOPSIS | |
Retrieves a list of all software installed | |
.EXAMPLE | |
Get-InstalledSoftware | |
This example retrieves all software installed on the local computer | |
.PARAMETER Name | |
The software title you'd like to limit the query to. |
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 Find-InTextFile | |
{ | |
<# | |
.SYNOPSIS | |
Performs a find (or replace) on a string in a text file or files. | |
.EXAMPLE | |
PS> Find-InTextFile -FilePath 'C:\MyFile.txt' -Find 'water' -Replace 'wine' | |
Replaces all instances of the string 'water' into the string 'wine' in | |
'C:\MyFile.txt'. |
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 2.0 | |
function Get-ADSiteFromComputer | |
{ | |
<# | |
.Synopsis | |
Return the site that a computer is member of | |
.DESCRIPTION | |
Given a computer name, it looks up its IP address and checks which AD site's subnet it is in | |
.EXAMPLE |
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
$list = @' | |
1 Partridge in a pear tree | |
2 Turtle Doves | |
3 French Hens | |
4 Calling Birds | |
5 Golden Rings | |
6 Geese a laying | |
7 Swans a swimming | |
8 Maids a milking | |
9 Ladies dancing |
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
$date = get-date | |
if (get-eventlog -logname system -source disk -newest 1 | where-object { [dateTime]$_.Time -eq $date }) | |
{ | |
GET-WMIOBJECT –class win32_logicaldisk | where { $_.DriveType -eq 3 } | foreach { fsutil dirty set $_.DeviceID } | |
} | |
else | |
{ | |
Write-Output "nothing to do!" | |
start-sleep -s 10 |
OlderNewer