Skip to content

Instantly share code, notes, and snippets.

@daveselias
daveselias / Start-LDallPolicyTasks.ps1
Created June 2, 2016 01:43
start all LANDesk 9.6sp2 scheduled tasks
$core = "MyCoreServerName"
$ldmS = New-WebServiceProxy -uri http://$core/MBSDKService/MsgSDK.asmx?WSDL -UseDefaultCredential
$TASKS = $LDMS.ListSWDTasks()
$NoPush = $TASKS.ScheduledTasks | Where-Object {($_.DeliveryMethodName -notlike '*push*') -and ($_.Status -like "Available For Download")} | Sort-Object TaskID
$T = $NoPush.count
$N=0
ForEach($Task in $NoPush){
$N++
$Started = $LDMS.StartTaskNow("$($Task.TaskID)","all")
IF($Started -eq $true){
@daveselias
daveselias / Get-AppGroups.ps1
Created May 22, 2016 12:50
AD group lookup GUI
#*=============================================
#* Script Name: Get-AppGroups.ps1
#* Created: 05/18/2016-published
#* Author: David S. Elias
#* Email: [email protected]
#* Requirements: PowerShell v.3.0, ActiveDirectory Module
#*=============================================
function GenerateForm {
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
#* FileName: My-ADTools_v1.psm1
#*=============================================
#* Script Name: Create-ADVisio
#* Created: 07/01/2014-published
#* Author: David S. Elias
#* Email: [email protected]
#* Requirements: Read rights in Active Directory, Server Local Admin rights, SQL SysAdmin rights
#* Keywords: AD, SQL, share, groups, nested
#*=============================================
@daveselias
daveselias / Update-SSRS_Datasources
Last active August 29, 2015 14:05
PS script for updating the Connection string value in SSRS shared data sources
$OldSource = 'MySQLServer-01'
$NewSource = 'MySQLServer-02'
$URL = 'http://ReportServerName/ReportServer/ReportService2010.asmx?wsdl'
$URI = New-Object System.Uri($URL)
$SSRS = New-WebServiceProxy -Uri $URI -UseDefaultCredential
$DataSources = ($SSRS.ListChildren("/data sources", $true)).path
ForEach($Source in $DataSources){
@daveselias
daveselias / Import-RemoteCommands.ps1
Created July 16, 2014 11:30
PS script for importing remote commands, functions, modules, etc.
#* FileName: Import-RemoteCommands.ps1
#*=============================================
#* Script Name: Import-RemoteCommands
#* Created: 07/10/2014-published
#* Author: David S. Elias
#* Email: [email protected]
#* Requirements: PowerShell v2.0+
#* Keywords: Function, module, command, cmdlet, import, remoting
#*=============================================
@daveselias
daveselias / Send-RDPReport.ps1
Created March 16, 2014 16:18
Gather RDP Session info and send to user
Function Get-LoggedOnUser {
<#
.Synopsis
Queries a computer to check for interactive sessions
.DESCRIPTION
This script takes the output from the quser program and parses this to PowerShell objects
.NOTES
Name: Get-LoggedOnUser
Function Kill-Sessions{
Param(
[Array]$Computer
)
$AllSessions=@()
[int]$Number = 0
ForEach($ComputerName in $Computer){
$SystemSessions = (Get-LoggedOnUser -ComputerName $ComputerName -ErrorAction SilentlyContinue)
ForEach($Session in $SystemSessions){
$Number=($Number+1)
Function Get-TimeZone {
Param(
[Parameter(Mandatory=$True,Position=1)]
[Array]$ComputerName
)
$AllTime=@()
ForEach ($Computer in $ComputerName ) {
IF((gwmi -class Win32_SystemTimeZone -ComputerName $Computer -ErrorAction SilentlyContinue) -gt $null){
$Time = (Get-Time $Computer)