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
$servicenames = "svc1","svc2","svc3" | |
$services = Get-Service -ComputerName "servername" -Include $servicenames | |
$services | ft * | |
$services | Restart-Service |
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
# Set computer name | |
$c="servername" | |
$k="\\$c\HKLM\System\CurrentControlSet\Control\Terminal Server" | |
# Check Setting | |
reg query $k /v fDenyTSConnections | |
# Change it to 0, force overwrite of existing values | |
reg add $k /v fDenyTSConnections /t REG_DWORD /d 0 /f |
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
-- search the jobs for a specific text | |
select | |
[InstanceName] = serverproperty('servername') | |
, j.job_id | |
, j.name | |
, js.step_id | |
, js.command | |
, j.enabled | |
from | |
msdb.dbo.sysjobs j |
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
# set machine and service | |
$a = "server" | |
$b = "service name" | |
# if needed, below could be used to search for wildcard first to find service. | |
gwmi win32_service -ComputerName $a | where name -like "*service name filter*" | ft * | |
# or | |
gsv -c $a | where name -like "*service name filter*" | |
# view some additional details about the service pre-change (namely, this has path where gsv doesn't) |
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
// originally posted on my blog in 2006 | |
using System; | |
using System.IO; | |
using System.Text.RegularExpressions; | |
namespace parse.eml | |
{ | |
class Email | |
{ | |
string _path,_to,_from,_subject,_urls; |
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
class Email | |
def initialize(p) | |
@name = p | |
fc = IO.read(p) | |
hdr = fc.split(/^\s*$/)[0] | |
body = fc.sub(".{" + hdr.size.to_s + ",}",'') | |
@from = /^From: (.+$)/.match(hdr).to_a[0] | |
@to = /^To: (.+$)/.match(hdr).to_a[0] | |
@subject = /^Subject: (.+$)/.match(hdr).to_a[0] |
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
using System.IO; | |
using System.Text.RegularExpressions; | |
namespace StripCR | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
nocr(args[0]); |
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
file = ARGV[0] | |
fc = IO.read(file).gsub(/\r/,"") | |
File.open(file,'w'){|f| | |
f.print(fc) | |
} |
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
using System; | |
using System.IO; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Web.UI; | |
using System.Xml; | |
public partial class _Default : Page | |
{ | |
static XmlTextWriter xml; |
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
using c = System.Console; | |
using d = System.IO.Directory; | |
using di = System.IO.DirectoryInfo; | |
using fi = System.IO.FileInfo; | |
using s = System.String; | |
namespace Glob | |
{ | |
class Program | |
{ |