This file contains 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
$sRawOutput -replace ':\\: =>', '=' |
This file contains 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
Grant user 'Log on as batch job' rights | |
======================================= | |
NTRIGHTS.EXE: | |
* NTRIGHTS.exe is part of the Windows Server 2003 Resource Kit. | |
Once installed, NTRIGHTS.exe resides in 'C:\Program Files (x86)\Windows Resource Kits\Tools\'. | |
* I have tested it on Windows Server 2012 R2 x64, works fine. | |
* [ ] Run the following command: ntrights -u <USERNAME> +r SeBatchLogonRight | |
SECPOL.MSC: |
This file contains 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
$ExpectedValue = "Ping statistics for 127.0.0.1:" | |
$Binary = "ping.exe" | |
$Arguments = "127.0.0.1 -n 10" | |
$ProcessStartInfo = New-Object System.Diagnostics.ProcessStartInfo | |
$ProcessStartInfo.UseShellExecute = $false | |
$ProcessStartInfo.RedirectStandardError = $true | |
$ProcessStartInfo.RedirectStandardInput = $true | |
$ProcessStartInfo.RedirectStandardOutput = $true | |
$ProcessStartInfo.FileName = $Binary |
This file contains 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
# List approved and decline updates, including details such as the computer | |
# group(s) for which they have been approved/declined and the date/time on which | |
# the action was taken. | |
# NB: If an administrator has neither approve or declined an update then it is | |
# implcitly classified as 'NotApproved'. However, it would appear that the | |
# 'GetUpdateApprovals' method (used below) does NOT retrieve such updates. | |
$serverName = "TestServer" | |
$portnumber = 8530 |
This file contains 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
The bridge bot of #powershell on freenode puts a zero-width space character after the first letter of Slack | |
nicks, to avoid people who are on both sides of the bridge triggering their own @mention. | |
Source machine: | |
* Windows Version: Windows 10 Pro, Version 1709, 16299.431 | |
* Font used in conhost: Consolas (for both OpenSSH on Windows Subsystem for Linux and Win32-OpenSSH) | |
Target server: | |
* Ubuntu version: Ubuntu 16.04.4 LTS |
This file contains 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
<?xml version="1.0"?> | |
<catalog> | |
<book> | |
<author>Gambardella, Matthew</author> | |
<title>XML Developer's Guide</title> | |
<genre>Computer</genre> | |
<price>44.95</price> | |
<publish_date>2000-10-01</publish_date> | |
<description>An in-depth look at creating applications | |
with XML.</description> |
This file contains 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
$TaskName = "My Scheduled Task"; | |
$SchedTaskCred = Get-Credential "domain\user" ` | |
-Message "Scheduled Task Service Account Credentials"; ` | |
$SchedTaskCredUser = $SchedTaskCred.UserName; ` | |
$SchedTaskCredPwd = $SchedTaskCred.GetNetworkCredential().Password; ` | |
$Action = New-ScheduledTaskAction ` | |
-Execute "PowerShell.exe" ` | |
-Argument '-ExecutionPolicy Bypass -file "C:\MyScript.ps1"' ` | |
-ErrorAction Stop; ` | |
$Trigger = New-ScheduledTaskTrigger ` |
This file contains 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
@echo off | |
cls | |
echo [101;93m STYLES [0m | |
echo ^<ESC^>[0m [0mReset[0m | |
echo ^<ESC^>[1m [1mBold[0m | |
echo ^<ESC^>[4m [4mUnderline[0m | |
echo ^<ESC^>[7m [7mInverse[0m | |
echo. | |
echo [101;93m NORMAL FOREGROUND COLORS [0m | |
echo ^<ESC^>[30m [30mBlack[0m (black) |
This file contains 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 | |
echo "This script updates your moodle installation." | |
echo "You will need a few pieces of information to complete this process." | |
echo "" | |
echo "Warning: This will disable Web-Access to the moodle installation!" | |
echo "Make sure nobody is logged in at the moment or activate maintenance mode manually so no data is lost." | |
echo "" | |
echo "" |
This file contains 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
// Filename: TcpChatMessenger.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.Text; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; |