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
Import-Module -Name 'ConfigurationManager' | |
$SiteCode = 'LCL' | |
$Location = Get-Location | |
Set-Location $SiteCode":\" -ErrorAction 'Stop' | |
$Collection = Get-CMDeviceCollection -Name 'HR_Servers' | |
if ($Collection) | |
{ | |
$Rule = $Collection | Get-CMDeviceCollectionQueryMembershipRule | Where-Object { $_.RuleName -eq 'HR server manaul query' } | |
if ($Rule){ Remove-CMDeviceCollectionQueryMembershipRule -CollectionId $Collection.CollectionID -RuleName $Rule.RuleName -Force } |
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
$FilePath = 'C:\Temp\report_01.csv' | |
$OutputPath = 'C:\Temp\report_02.csv' | |
$Key = Split-Path -Path $FilePath -Leaf | |
$Url = 'https://s3.aws.com' | |
$BucketName = 'us-east-low-rw-team-a-shared' | |
$ProfileName = 'low_teams_shared' | |
Set-AWSCredential -AccessKey 'AWS_ACCESS_KEY' -SecretKey 'AWS_PASSWORD' -StoreAs $ProfileName | |
Set-AWSCredential -ProfileName $ProfileName | |
Write-S3Object -EndpointUrl $Url -BucketName $BucketName -Key $Key -File $FilePath |
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
<# | |
// Data class to be inventoried by SCCM hardware inventory on the client | |
[SMS_Report(TRUE),SMS_Group_Name("Certificates"),SMS_Class_ID("Custom Inventory|Certificates|1.0")] | |
Class Certificates: SMS_Class_Template | |
{ | |
[ SMS_Report (FALSE), Key ] String Thumbprint; | |
[ SMS_Report (FALSE) ] String Subject; | |
[ SMS_Report (FALSE) ] String NotBefore; | |
[ SMS_Report (FALSE) ] String NotAfter; | |
[ SMS_Report (FALSE) ] String SignatureAlgorithm; |
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
$Principal = New-ScheduledTaskPrincipal -GroupId 'BUILTIN\Users' | |
$Command = Join-Path $env:SystemRoot -ChildPath 'System32\WScript.exe' | |
$Argument = '//NoLogo //B //T:120 "C:\Windows\LogonScript.vbs"' | |
$TaskAction = New-ScheduledTaskAction -Execute $Command -Argument $Argument | |
$TaskSetting = New-ScheduledTaskSettingsSet -Compatibility 'Win8' -ExecutionTimeLimit '00:05' -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -DontStopOnIdleEnd | |
$TaskTrigger = @((New-ScheduledTaskTrigger -AtLogOn), (New-ScheduledTaskTrigger -At '7am' -Daily)) | |
$TaskTrigger | Where-Object { $_.StartBoundry } | ForEach-Object { $_.StartBoundry = [DateTime]::Parse($_.StartBoundry).ToLocalTime().ToString('s') } | |
$Task = New-ScheduledTask -Action $TaskAction -Trigger $TaskTrigger -Settings $TaskSetting -Principal $Principal | |
$Task.Description = 'Scheduled task to run logon script at user logon and every day at 7am' | |
Register-ScheduledTask -InputObject $Task -TaskPath '\' -TaskName 'LogonScript' |
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
Option Explicit | |
On Error Resume Next | |
Dim objshell, strPSPath, strPSArg, strScriptFolder | |
Set objShell = WScript.CreateObject("WScript.Shell") | |
strPSPath = objShell.ExpandEnvironmentStrings("%SystemRoot%") & "\System32\WindowsPowerShell\v1.0\Powershell.exe" | |
strScriptFolder = Left(WScript.ScriptFullName, (Len(WScript.ScriptFullName) - (Len(WScript.ScriptName)))) | |
strPSArg = "-ExecutionPolic ByPass -NonInteractive -NoProfile -File " & Chr(34) & strScriptFolder & "Run-LogonScript.ps1" & Chr(34) | |
objShell.Run Chr(34) & strPSPAth & Chr(34) & Chr(32) & strPSArg, 0, True |
OlderNewer