Categories
blog howto windows

Enable Remote Desktop Remotely with PSEXEC

Download PSTOOLS from microsoft. Unzip to an easy to access location.
Open a CMD command prompt, navigate to the PSTOOLS location.
Execute:

psexec \\machinename reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0

Machinename should be replaced with the computername, ideally you already have admin rights to this PC, for example you run this as the domain administrator. Otherwise the have to supply credentials using -u and -p options.
If you still can’t connect this is most likely the windows firewall.
Execute:
psexec \\machinename netsh firewall set service remotedesktop enable
psexec \\machinename netsh firewall set service remoteadmin enable

Categories
blog howto windows

Uninstall Trend Micro Officescan without password

Uninstall Trendmicro officescan without knowing the password

Open Ofcscan.ini inside C:\Program Files\Trend Micro\OfficeScan Client
Change the value of the Uninstall_Pwd to !CRYPT!5237C1A1888FAFC830342D0AB1AD8410C995F3E7C1FBB9FE857C7B1FEBE9F84A93A1B9CEF52810DBA9649332838
Change the value of the Unload_Pwd to !CRYPT!5237C1A1888FAFC830342D0AB1AD8410C995F3E7C1FBB9FE857C7B1FEBE9F84A93A1B9CEF52810DBA9649332838
To Unload or uninstall the OfficeScan use novrius as the password.

thanks to: bpursley

Categories
blog howto server windows

EXCHANGE 2010: SAN Certifcate with mutiple DNS names (private windows CA)


New-ExchangeCertificate -FriendlyName "Exchange 2010 multiple DNS" -IncludeServerFQDN -DomainName mail.*****.***,autodiscover.******.***,computername.*****.local,computername -GenerateRequest -PrivateKeyExportable $true

Copy the full code you receive including the —BEGIN… and —END… lines.
Open the sertificate services web interface.
http://serverdc/certsrv
-Request a certificate -> Advanced certificate request -> Submit a Certificate request by using …
Paste the code you received in the textbox, on the template dropdown select Web Server.
Click Submit.
On the next page click on Download Certificate.
Save the file on disk somewhere.
Go to Exchange console (GUI) – server Configuration – Hub transport – Exchange certificates.
Right click on the pending request and choose “Complete pending request”.
Select the file you saved to disk and finish the wizard.
When finished right click on the now completed certificate and choose “Assign services”.
Assign all services (except Unified messaing), choose YES to All for overwrite.
Delete all other certificates no longer needed.

Test your OWA and see what certificate is now being used.

Reference: http://exchangeserverpro.com/how-to-issue-a-san-certificate-to-exchange-server-2010-from-a-private-certificate-authority

Categories
blog howto

Call of Duty Modern Warfare 3 port forwarding (NAT type Open)

If UPNP or DMZ is not an option for you (or you want more security), you can manually forward some ports to get NAT Type OPEN for Call of Duty Modern Warfare 3.
28960 is the port that COD has always used, but you need some steam ports too. The screenshot below might have some ports that are only needed for outgoing connections but documentation is really hard to find about these ports. It works for me with these ports.
COD MW3 port forwarding
To sum up the ports: 28960 (TCP+UDP), 1500 (TCP), 3005 (UDP), 3101 (UDP), 2700-2704 (UDP), 2715-2717 (UDP), 3074 (UDP). You have to forward these ports in your router/modem to your PC. I suggest you read documentation or search the Internet on how to forward ports for your router/model type.

Remember that if you have Windows firewall of another software firewall on your PC enabled you need to add an exception for all these ports in the firewall.

Categories
blog howto server windows

EXCHANGE 2007: Certifcate with mutiple DNS names

http://www.exchangeinbox.com/article.aspx?i=127

New-ExchangeCertificate -GenerateRequest -Path c:\install\mail_cert_request.csr -SubjectName "c=BE, o=******, ou=IT, cn=mail.*****.com" -DomainName: mail.******.com, autodiscover.*****.com, MAILSRV2, MAILSRV.*****.**, mail.****.**-KeySize 1024 -PrivateKeyExportable: $true
certreq.exe -submit -attrib "CertificateTemplate:WebServer" c:\install\MAIL_cert_request.csr

Choose the right CA, choose output folder. Open inside Issued certificates in Cert. MMC. Go to details. Click Copy to -> Complete chain, save as p7b file.

Import-ExchangeCertificate -Path C:\install\mail2.*****.com.p7b
Enable-ExchangeCertificate -Thumbprint 5B485A86***********60A04 -services IIS, POP, IMAP, SMTP
Remove-ExchangeCertificate -Thumbprint oldcertificatesthumbprint

Categories
blog howto linux server

DUF alias for sorted du -h

Show disk usage (human readable) for each folder/file sorted by size!

alias duf='du -sk * | sort -n | perl -ne '\''($s,$f)=split(m{\t});for (qw(K M G)) {if($s<1024) {printf("%.1f",$s);print "$_\t$f"; last};$s=$s/1024}'\'
Usage: duf

Alternative without perl:
du -sk * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done


Tested on: Linux (Redhat, Centos, Debian), Unix (Solaris, SunOS)
Author: http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/

Categories
blog howto windows

Windows 7 change product key and activate from command line

Open CMD as Administrator (elevated).
cd /d %systemroot%\system32
cscript slmgr.vbs /inpkey:XXXXX-YYYYY...
cscript slmgr.vbs /ato

Windows 10/2016/2019:

cd /d %systemroot%\system32
cscript slmgr.vbs /ipk XXXXX-YYYYY...

Good luck.

Categories
blog howto windows

Office 2010 command line activate or change product key

Cloned PC, changed office key. Got error with license information on restart office. Ativated through CMD and all was OK.
Open CMD as Administrator.
cd c:\Program Files (x86)\Microsoft Office\Office14
cscript ospp.vbs /act

If you want to change product key through command line it is like this:
cscript ospp.vbs /inpkey:XXXXX-YYYYY....

Categories
blog howto server windows

Errors with ntbackup caused by shadow copy.

Portions of FILENAME cannot be read. The backed up data is corrupt or incomplete. This file will not restore correctly.

I would receive this error numerous times in my ntbackup log.

In my case the C: drive would backup without any issue, but the D: drive would show these errors for every file in use.

My backup destination was a 2TB USB disk (G:) with a newer cluster size that is greater than 512. This is not really an issue for storing the backups. But somehow my shadow copy settings on the D: drive were using the G: backup drive as the place to store the shadow copies for the D: drive. And storing shadow copies on a drive with cluster size != 512 will fail. Note: on the G: drive itself shadow copies are disabled. Not needed for backup drive and will fail anyways because of above mentioned reason.

Categories
blog howto linux server

Ubuntu upgrade from 10.10 to 11.04 broke grub

After upgrading my Ubuntu server from 10.10 to 11.04 using the “do-release-upgrade” method, my system would no longer boot.
It was stuck on a GRUB shell. I downloaded the liveCD, booted from that and ran the excellent Boot-Repair utility. I had to install it using apt-get, so you need an internet connection. They should include it in the liveCD. I belive you can also download a Boot-Repair ISO file to boot from.

But the Boot-Repair tool worked great and fixed my GRUB in no time.
I see a lot of problems with GRUB after the upgrade. Maybe it’s a bug that affects people who, in the past, already upgraded from 9.x or 8.x to 10.x. So people who had GRUB v1 at some point in time.