View json.cs
public static T GetEdmundsContent<T>(string url) where T : new() | |
{ | |
using (var client = new WebClient()) | |
{ | |
var jsonData = string.Empty; | |
try | |
{ | |
Sleep(1000); | |
jsonData = client.DownloadString(url); | |
} |
View Copy-OuDelegation.ps1
<# | |
.SYNOPSIS | |
Template script | |
.DESCRIPTION | |
This script sets up the basic framework that I use for all my scripts. | |
.PARAMETER | |
.EXAMPLE | |
.NOTES | |
ScriptName : Copy-Delegations.ps1 | |
Created By : jspatton |
View New-SPOSite.ps1
# | |
# Need this | |
# http://www.microsoft.com/en-ie/download/confirmation.aspx?id=35585 | |
# | |
Add-Type -Path "c:\folder\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "c:\folder\Microsoft.SharePoint.Client.Runtime.dll" | |
$siteUrl = "https://tenant.sharepoint.com/sites/things" | |
$credentials = (Get-Credential) | |
$ClientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) |
View ArinPortableAPI.cs
namespace ArinPortableAPI | |
{ | |
using System; | |
using System.IO; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using System.Xml.Serialization; | |
public class ArinLookup | |
{ | |
public static string ApiUrl = "http://whois.arin.net/rest"; |
View Copy-AdAcl.ps1
# | |
# Copy AD ACL Rules | |
# | |
param | |
( | |
$adPath, | |
$secPrincipal, | |
$newPrincipal | |
) |
View Reset-HealthState.ps1
Function Reset-HealthState | |
{ | |
param | |
( | |
$AlertName, | |
$ResolutionState | |
) | |
$Criteria = "Name like '$($AlertName)' and ResolutionState != $($ResolutionState)" | |
$Alerts = Get-SCOMAlert -Criteria $Criteria |
View Set-UserPhoto.ps1
function Set-UserPhoto | |
{ | |
<# | |
.SYNOPSIS | |
Set the thumbnailPhoto property for a user | |
.DESCRIPTION | |
This function uses the ActiveDirectory Module to get and set | |
user properties. Specifically it replaces whatever is in the | |
thumbnailPhoto property with a photo. | |
.PARAMETER sAMAccountName |
View Sample-NetActivity.ps1
# | |
# Enable-WSManCredSSP -Role Client -DelegateComputer localhost | |
# Enable-WSManCredSSP -Role Server | |
# | |
Try{ | |
$ErrorActionPreference = "Stop"; | |
$WinRMUser = "\`d.T.~Ed/{34846A7C-5BC4-4C23-A22A-D21C1DC99DF8}.{5408AD4E-3052-4F73-B45E-7DADBB999FE4}\`d.T.~Ed/"; | |
$WinRMPass = ConvertTo-SecureString -String "\`d.T.~Ed/{34846A7C-5BC4-4C23-A22A-D21C1DC99DF8}.{98301C29-F4AF-4A43-88D3-851520744C6B}\`d.T.~Ed/" -AsPlainText -Force; | |
$Credential = New-Object System.Management.Automation.PSCredential ($WinRMUser, $WinRMPass); | |
# |
View Set-ZenossPermissions.ps1
<# | |
.SYNOPSIS | |
Setup permissions for Zenoss monitoring on Windows | |
.DESCRIPTION | |
This script works under the assumption that you have a GPO or manually added your zenoss user to several groups. | |
In testing these are the groups that appear to work | |
Backup Operators | |
Distributed COM Users | |
Event Log Readers | |
Performance Log Users |
OlderNewer