Skip to content

Instantly share code, notes, and snippets.

portqry -n www.petri.co.il -p tcp -e 80
portqry -n server1.dpetri.net -p tcp -r 21:143
portqry -n server1.dpetri.net -p udp -e 389
@Kimanibob
Kimanibob / Enable RDC remotely
Created May 7, 2013 11:28
Enable RDC remotely
reg add "hklm\system\currentControlSet\Control\Terminal Server" /v "AllowTSConnections" /t REG_DWORD /d 0x1 /f
reg add "hklm\system\currentControlSet\Control\Terminal Server" /v "fDenyTSConnections" /t REG_DWORD /d 0x0 /f
1. net use \\machineName  /USER:machineName\user password
2. PsExec.exe -s \\machineName ipconfig
@Kimanibob
Kimanibob / Weekly Meetings
Created May 7, 2013 11:20
Weekly Meetings
Every Tuesday at 8.30AM
Windows 2008 R2
Import-Module ServerManager
Add-WindowsFeature
Web-Static-Content,Web-Default-Doc,Web-Http-Errors,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Http-Logging,Web-Log-Libraries,Web-Http-Tracing,Web-Windows-Auth,Web-Client-Auth,Web-Filtering,Web-Stat-Compression,Web-Mgmt-Console,Web-Scripting-Tools,MSMQ-Server,MSMQ-Directory,NET-Framework-Core,RSAT-ADDS,Web-Dyn-Compression,Desktop-Experience
Import-Module ServerManager
Add-WindowsFeature NET-Framework-Core
@Kimanibob
Kimanibob / Link
Created May 7, 2013 11:12
Allow Relay on Exchange 2010
@Kimanibob
Kimanibob / Exchange Certificate Services
Created May 7, 2013 11:10
Set Exchange Certificate Services (IMAP, POP, IIS, SMTP)
Enable-ExchangeCertificate -Server 'SVDCEXCAS01' -Services 'IMAP, POP, IIS, SMTP' -Thumbprint '6c99cc9db7724c99f5c89e0608e6739f8a25413f'
@Kimanibob
Kimanibob / Remove Default Exchange 2010 Database
Created May 7, 2013 11:07
Delete Exchange 2010 Database (Default)
Add-MailboxDatabaseCopy -Identity 'Mailbox Database' -MailboxServer 'S-DRS-MSG-001' -ActivationPreference '2'
New-MoveRequest -Identity 'FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042' -TargetDatabase CO-OPHSE
New-MoveRequest -Identity 'SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}' -TargetDatabase CO-OPHSE
New-MoveRequest -Identity 'SystemMailbox{1f05a927-a8aa-4519-a2c0-2ea0e0b9430f}' -TargetDatabase CO-OPHSE
@Kimanibob
Kimanibob / Exchange 2010 Prerequsites
Created May 7, 2013 11:06
Exchange 2010 Installation Prerequsites
Import-Module ServerManager
Use the Add-WindowsFeature cmdlet to install the necessary operating system components:
This example is for a server that will have the typical installation of the Client Access, Hub Transport, and Mailbox server roles.
Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,Web-Asp-Net,Web-Client-Auth,Web-Dir-Browsing,Web-Http-Errors,Web-Http-Logging,Web-Http-Redirect,Web-Http-Tracing,Web-ISAPI-Filter,Web-Request-Monitor,Web-Static-Content,Web-WMI,RPC-Over-HTTP-Proxy -Restart
This example is for a server that will host the Client Access, Hub Transport, Mailbox, and Unified Messaging server roles.
Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,
@Kimanibob
Kimanibob / Self Signed
Created May 7, 2013 11:03
Certificates
selfssl7 /N cn=lync.savannah.local;cn=dialin.savannah.local;cn=dialin.savannahcement.com;cn=meet.savannahcement.com;cn=meet.savannah.local;cn=admin.savannahcement.com;cn=LyncdiscoverInternal.savannahcement.com;cn=LyncdiscoverInternal.savannah.local;cn=lync.savannahcement.com;cn=Lyncdiscover.savannahcement.com;cn=Lyncdiscover.savannah.local /K 2048 /V 18250 /I /S "Default Web Site" /P443 /A * /T /Q
Exchange Selfsigned Certificate:
selfssl7 /N cn=webmail.ewsa.rw;cn=autodiscover.bigshots.com;cn=exchange.bigshots.local;cn=mail.bigshots.local;cn=autodiscover.bigshots.local /K 2048 /V 18250 /I /S "Default Web Site" /P443 /A * /T /Q
Bigshots Lync certificate:
selfssl7 /N cn=lync.bigshots.co.ke;cn=dialin.bigshots.co.ke;cn=meet.bigshots.co.ke;cn=admin.bigshots.co.ke;cn=LyncdiscoverInternal.bigshots.co.ke;cn=Lyncdiscover.bigshots.co.ke /K 2048 /V 18250 /I /S "Default Web Site" /P443 /A * /T /Q