Skip to content

Instantly share code, notes, and snippets.

@desek
desek / PSSessionSecurityConfiguration.ps1
Last active August 29, 2015 14:07
Remote Powershell security permissions
Set-PSSessionConfiguration -ShowSecurityDescriptorUI -Name Microsoft.PowerShell -Force
function Get-MSFT2014TechnicalPreview
{
[CmdletBinding()]
Param(
[ValidateScript({Test-Path $_})]
[string]$Path=(Get-Location),
[Switch]$WithProgress
)
BEGIN
{
# Modified version of http://poshcode.org/5474 by @sorlov
function DoSomething {}
function Check-WindowsPreview
{
PARAM(
[int]$Sleep=10,
[switch]$WaitForIt
)
@desek
desek / DisableSMDWCubeProcessing.ps1
Last active August 29, 2015 14:06
Disable SCSM Cube processing and disable SSAS
# Script to remotely stoping and disabling all SCSM Cube Procesing jobs and SSAS instance
$SMDWServer = ""
$SSASServer = ""
$SSASInstanceName = "MSSQLSERVER"
Invoke-Command -ScriptBlock {
$smdir = (Get-ItemProperty "HKLM:\Software\Microsoft\System Center\2010\Service Manager\Setup").InstallDirectory
Import-Module "$smdir\Microsoft.EnterpriseManagement.Warehouse.Cmdlets.psd1"
$DWJobs = Get-SCDWJob | Where-Object {$_.Name -like "Process.*"}
Foreach ($DWJob in $SCDWJobs)
@desek
desek / ProcessSCSMDW.ps1
Last active November 9, 2021 16:09
Rerun all SCSM DW jobs
$smdir = (Get-ItemProperty "HKLM:\Software\Microsoft\System Center\2010\Service Manager\Setup").InstallDirectory
Import-Module "$smdir\Microsoft.EnterpriseManagement.Warehouse.Cmdlets.psd1"
$SleepTimer = 120
$JobTypes = @(
"DWMaintenance",
"MPSyncJob",
"Extract_",
"Transform.",
@desek
desek / Get-OMSDKLogons.ps1
Last active August 29, 2015 14:06
OMSDK Logons from Event Log
$Events = Get-EventLog -LogName 'Operations Manager' -EntryType Information | Where-Object {$_.EventID -eq 26328}
$Logons = @()
Foreach ($Event in $Events)
{
If ($Event.ReplacementStrings[0] -notin @($Logons.UserName))
{
$Props = [ordered]@{
UserName = $Event.ReplacementStrings[0]
LastLogon = $Event.TimeGenerated