Category Archives: All Articles

Update AD users from CSV

Create a CSV file with relevant data i.e. sAMAccountName,postalCode,givenName,sn user.name,444444,user,name Then import and run piping results to a csv.  Adapt the CSV and Set-AdUser sections to do what job you need. $data = Import-CSV -Path .\data.csv $data | ForEach-Object { $user = Get-ADUser -Filter “sAMAccountName -like ‘*$($_.sAMAccountName)*’” -Properties st,postalCode Set-ADUser -identity $user.sAMAccountName -PostalCode $_.postalCode }… Read More »

Licensing Office 365 via script

Powershell script that can be adapted to license Office 365 with various service plans. Import-Module MSOnline  Connect-MsolService -Credential $Credentials $SessionParams = @{     ConfigurationName = “Microsoft.Exchange”     ConnectionUri = “https://outlook.office365.com/powershell-liveid/”     Credential = $Credentials     Authentication = “Basic”     AllowRedirection = $true}   $Session = New-PSSession @SessionParams Import-PSSession -Session $Session -DisableNameChecking:$true -AllowClobber:$true | Out-Null #Get… Read More »

Powershell script to delete inactive computer accounts.

A nice quick script to get machines that have not logged on to the network in over x days, move to another OU and disable.   $d = [DateTime]::Today.AddDays(-365) $todisable = Get-ADComputer -Filter ‘PasswordLastSet -le $d’ -Properties PasswordLastSet | Where-Object {$_.DistinguishedName -notlike “*OU=Disabled*”} $todisable | %{Move-ADObject -Identity $_.DistinguishedName -TargetPath “OU=Disabled,OU=Computers,DC=domain,DC=local” | FT Name,PasswordLastSet} $todisable |… Read More »

ReadyData Replicate failing with “zfs: Bad file number (2070)” 5200

Are you seeing this error on your replicates [2014-05-14 00:01:58] [INFO] Connect to destination[2014-05-14 00:01:58] [INFO] Connected[2014-05-14 00:01:58] [INFO] START block sent[2014-05-14 00:01:59] [INFO] START block received[2014-05-14 00:01:59] [ERROR] Target unable to resume[2014-05-14 00:01:59] [ERROR] Transfer failed[2014-05-14 00:01:59] [INFO] Sent total 83.08 KB[2014-05-14 00:01:59] [INFO] Average speed 41.54 KB/s[2014-05-14 00:02:20] [ERROR] zfs: Bad file number… Read More »

Updating URL Hyperlinks within Excel

Recently I had an issue where a user moved a spreadsheet that contained hundreds of hyperlinks to files stored on the server. Obviously once moved none of the links worked and I was tasked with trying to change all these links without spending weeks doing it manually. The only real option is to create a… Read More »

Set Out of office for multiple users

If you need to set the out of office for multiple users you can use a powershell script Set-MailboxAutoReplyConfiguration ALIAS -AutoReplyState scheduled -StartTime “07/12/2013 14:05:00” -EndTime “08/05/2013 08:00:00” -ExternalAudience all -InternalMessage $oof -ExternalMessage $oof where the variable $oof is a predefined message. $oof = “I’m not in the office currently” Here I’ll give a more… Read More »

A simple VBS script to change IE Proxy Settings

I give this script to remote users so they can remove the Proxy settings when off site. set WshShell = CreateObject(“WScript.Shell”) Const HKEY_CURRENT_USER = &H80000001 strComputer = “.” Set objRegistry = GetObject(“winmgmts:\” & strComputer & “rootdefault:StdRegProv”) strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionInternet Settings” wshshell.run “tskill iexplore /a” strValueName = “ProxyEnable” dwValue = 0 objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue… Read More »