Tag Archive: script


To upgrade a Miktorik’s firmware, its fairly easy. Put in the file, and reboot it. But there isn’t an way to schedule a reboot.

 

I have made a script to make it easy.

View full article »

Powershell script to add users into AD Group for local and Office 365 setups.

Create users in a CSV File with UserName as first heading.

UserName
Import-module ActiveDirectory 
 
Import-CSV "C:\Users.csv" | % {Add-ADGroupMember -Identity NameOfGroup -Member $_.UserName} 

Adjust the red items to be where your file is

Now that we have lots of 4G dongles providing clients a failover when their ADSL dies (crappy copper means when not if) We need to monitor the status of the routes.

For this to work you need to do a few things first.

View full article »

I needed a way of resolving DNS Names to IPs to use in firewall rules.

 

/ip firewall address-list
add address=216.58.220.100 comment=www.google.com list=dns_list
add address=1.2.3.4 comment=www.website1.com list=dns_list
add address=157.56.242.98 comment=outlook.com list=dns_list

 

/system scheduler
add interval=9m1s name=DNSLookup on-event=DNSLookupScrip policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
jan/01/1970 start-time=00:00:01

/system script
add name=DNSLookupScrip policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive source=”:foreach \
dnsitems in=[ /ip firewall address-list find where list=\”dns_list\” ] do={\
\r\
\n /ip firewall address-list set \$dnsitems address=[:resolve [/ip firewall \
address-list get \$dnsitems comment]];\r\
\n};”

OR

:foreach dnsitems in=[ /ip firewall address-list find where list=”dns_list” ] do={
/ip firewall address-list set $dnsitems address=[:resolve [/ip firewall address-list get $dnsitems comment]];
};

 

 

We needed a way of creating 200+ mailboxes in an Exchange 2010 – Office 365 Hybrid. The best way was to create the accounts locally, let the AD sync tool create the accounts into Office 365 then assign a licence to the users (I’m sure we could automate that too, but this will not be a huge issue)

So you need a few things to make it all work

 

View full article »

We have all had problems with users saving files where we don’t want them. Like saving files to their desktop on a laptop, or saving files to the local my document folder. Today, I found the solution!

 

I have created a script

View full article »

The final script i needed to get all emails addresses out there was for 2003, google helped me.

With help from http://exchangepedia.com/2005/09/how-to-export-all-email-addresses-from-a-domain.html i managed to get the script working.

View full article »

I needed a way of listing access rights for users on shared mailboxes.

Google helped me out along with a little playing.

So I now have two PowerShell lines. One that lists users with full access to a mailbox, the other shows all users with the send as role.

View full article »

On Terminal server, with re-directed printers setting the printer more often than not goes to the wrong one.

The simple solution is this VBS Script. Placed in the users Startup folder, it maps the default printer to the one named.

 

Simply name the local printer

Option Explicit
Dim objPrinter
Set objPrinter = CreateObject(“WScript.Network”)
objPrinter.SetDefaultPrinter “serverprinter name

Sometimes this needs to be ran twice, but 99% of the time its happy.

On Terminal server, with re-directed printers setting the printer more often than not goes to the wrong one.

The simple solution is this VBS Script. Placed in the users Startup folder, it maps the default printer to the one named.

  View full article »