Category Archives: Scripting

Batch script to create and add local users to Administrators group

Basic batch file to create a local user and then add it to the local admin group net user “user1” “Pa$$w0rd” /addnet user “user2” “Pa$$w0rd” /addnet user “user3” “Pa$$w0rd” /add ...

Posted in Scripting | Leave a comment

Script to query a recursive DNS record

-I wrote this script around the following command:“nslookup -debug server1.devcorp.com”-The above command will display all the servers involved in resolving the DNS name in a recursive domain.-What the script does is cleans up the output ...

Posted in Scripting | Leave a comment

Getting a WWN from a Fiber Channel card

The below command can be used starting from server 2012 and up and it will list the WWN of a storage controller. Server 2012 or higher PortAddress is the WWN on this dual port FC adapterPS C:\Get-InitiatorPort Server 2008 or … Continue reading...

Posted in Scripting | Leave a comment

How to Export and Import Sites and Application pools in IIS

I recently had to move a lot of sites and app pools from server 2008 (IIS 7) to server 2016 (IIS 10) and found the below very useful. One issue i found when exporting all the sites is if the … Continue reading →...

Posted in Scripting | Tagged , | Leave a comment

Sending an e-mail with PowerShell

This is really useful if you want to test if a server is able to send out an e-mail through SMTP. Or just want to schedule a task to send out an e-mail once a month, Here are the details: … Continue reading →...

Posted in Microsoft, Scripting | Leave a comment

List Active Users in Active Directory – PowerShell

I had to decommission a domain that was being used by a small number of users. I needed a list of all users that were still active on it. The below script will list all users that recently logged into … Continue reading →...

Posted in Scripting | Tagged | Leave a comment

Generating a Multi-Domain CA signed SSL certificate request

One of our DEV environments had a CA signed SSL certificate with 30 Alternative names, every time a new site was added I had to re-generate the cert and an additional DNS entry. Doing it through the wizard took forever … Continue reading &rarr...

Posted in Microsoft, Scripting | Tagged , , | 1 Comment

Using Scrub command to secure erase data in RedHat Linux

Sometimes you may need to secure wipe information in Linux like disk, partition a file, there are other built in tools to do it in Linux but the below tool looks like lie the below tool covers the most standards. … Continue reading →...

Posted in Scripting | Leave a comment

Batch script to capture the IP of a rotating DNS record

Here is a script I wrote to capture a rotating IP address of a DNS A record. This is usually pretty common with Akamai or Cloudflare DNS servers where an IP for a DNS record will change randomly for security, … Continue reading →...

Posted in Networking, Scripting | Tagged , | Leave a comment

Script to rebind an IIS site to a new IP and a new SSL cert – PowerShell

Here is a script that I used during a DR failover test. We would failover a web server to a DR side,rename it, re-ip it, rebind the SSL certs. During this process it would loose the binding as the old … Continue reading →...

Posted in Microsoft, Scripting | Tagged , , , , | Leave a comment