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 * into #tmpag_availability_groups from master.sys.availability_groups |
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
cls | |
$sql = ([System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources() | Where { $_.InstanceName -ne 'SQLEXPRESS'}) | |
'number of intances found: {0}' -f $sql.Count | |
'-----------------------------------------' | |
$sql |
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
#!/bin/sh | |
if [ ! -d "$1" ]; then | |
echo "Usage $0 /path/to/sites" | |
exit 1; | |
fi | |
totalsize=0 | |
for site in `ls $1`; do |
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
#!/bin/bash | |
if [ ! -f "$1" ]; then | |
echo "Usage $0 file.txt" | |
exit 1; | |
fi | |
now=$(date +"%m_%d_%Y") |
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
#requires -version 4.0 | |
cls | |
$CurrentDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition) | |
$ProgDir = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0] | |
$LogParserExe = (Join-Path $ProgDir '\Log Parser 2.2\LogParser.exe') | |
$Header = @" |
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
using System; | |
using MailKit.Net.Smtp; | |
using MailKit; | |
using MimeKit; | |
namespace TestClient | |
{ | |
class SmtpClient: MailKit.Net.Smtp.SmtpClient |
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
cls | |
Import-Module ActiveDirectory | |
$d = (Get-date).AddDays(-30) | |
Get-ADComputer -Filter { (Enabled -eq $true) -and (OperatingSystem -like "*XP*") -and (PasswordLastSet -ge $d) } -Properties Name, OperatingSystem | ForEach-Object { | |
Write-Host $_.Name, $_.OperatingSystem | |
} |
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
DISM.exe /online /cleanup-image /spsuperseded | |
DISM.exe /online /Cleanup-Image /StartComponentCleanup |
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
cls | |
$features = dism.exe /online /get-features | Select-String "^Feature Name|^State" | |
$ParsedFeatures = @() | |
foreach ($str in $features) | |
{ | |
if ($str -like "*Feature Name*") | |
{ | |
$feature = New-Object -TypeName PSObject | |
$name = $str -replace "Feature Name : ","" | |
Add-Member -InputObject $feature -MemberType NoteProperty -Name FeatureName -Value $name |
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
<# | |
.SYNOPSIS | |
Create a CSV and HTML Report on Expiring Passwords | |
.DESCRIPTION | |
This script will create a report of passwords that are expiring within | |
the specified time. It will also list users who's passwords have already | |
expired. The script will create reports in 2 formats, CSV and HTML. | |
Both are then emailed to the specified user. | |
Make sure to edit and change the PARAM section to match your environment |
NewerOlder