Labels

3300 (1) 3PAR (1) Active Directory (1) ADFS (1) Admin Share (1) Auto-Sync (2) Auto-Sync locked (1) AWS (3) AzCopy (1) Azure (3) Backups (2) Broadcom (1) Call Forwarding (1) CLI (2) cmd (1) Compatibility View (1) Dameware MRC (1) Databases (1) DFS (1) DNS (1) Domain Admin (1) domain controller (1) Enterprise Mode (1) ESXi 5.0 (1) ESXi 5.1 (5) ESXi 5.5 (3) Exchange (3) Exchange 2010 (5) Extreme (1) ExtremeXOS (1) Federation (1) File Share (1) FSMO (1) GPO (1) Group Policy (1) Group Policy Client (1) Hardware Acceleration (1) Helpdesk (1) HP-UX (1) Hyper-V (2) IAM (1) IE10 (1) IE11 (1) IP conflict (1) Kayako (3) LDAP (1) Licence (1) Links (9) local groups (1) LUN lock (1) LUN number (1) MAC address (1) Microsoft Teams (1) Mitel (1) Namespaces (1) Networking (6) Nexenta (6) NMC (1) Office 365 (4) OneDrive (1) Outlook 2003 (1) Outlook 2013 (1) PC (1) Physical (1) PowerCLI (10) Powershell (10) promoted links (2) Public Folders (1) RDP (1) RDS (1) Recovery Services (1) RedShift (1) Registry (3) Reports (1) Resolve (2) Restart (1) RSA (1) Run As (1) SAML (1) SAN (1) Scavenging (1) script (10) Server 2003 (3) Server 2008 R2 (1) Server 2012 R2 (2) Servers (2) sharepoint 2013 (3) SMTP (3) Snapshot (2) SRM (1) SSH (5) SSL Certificate (2) Temporary profile (1) Terminal Server (3) Troubleshooting (5) Ubuntu (1) Update Manager (1) Useful Apps (1) VAAI (1) vCenter Server Appliance (1) VDI (1) VDP (1) Veeam Backup and Replication (2) VM (1) VM Error (1) vmdk (1) VMFS (1) vMotion (2) VMware (20) VoiP (1) vSphere 5.5 (4) vSphere 6.0 (2) vSphere 6.5 (1) vUM (1) webpart (1) Windows (3) Windows 10 (1) Windows 7 (2)

Wednesday, 30 December 2015

Find VM Attached RDM By WWN

In order to find an existing VM attached RDM by WWN use the script below;
Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | where {$_.ScsiCanonicalName -like "*WWN*"} | Select Parent, Name, DiskType, ScsiCanonicalName, DeviceName | fl
The output will look similar to the below if an RDM is found;

Parent                          : SERVER-NAME.domain
Name                            : Hard disk x
DiskType                     : RawVirtual
ScsiCanonicalName   : naa.WWN

DeviceName                : vml.DeviceName

Find VM Datastore By WWN

In order to find any existing VM datastore by WWN use the script below;
Get-Datastore | where {$_.extensiondata.info.vmfs.extent.diskname -like "*WWN*"}
The output will look similar to the below if a datastore is found;

Name                                       FreeSpaceGB      CapacityGB
----                                            -----------                 ----------
san01-lun01                            339.047                 499.750
san01-lun01                            339.045                 499.750

Wednesday, 23 December 2015

Check If A .VMDK Is Attached To A VM

Another quick PowerCLI script to check if a .vmdk file is associated with a VM
Get-VM | Get-HardDisk | Where {$_.Filename -like '*vmdk-name*'} | Select Parent, Filename
If the disk is in use you should get a response similar to

Parent                                                Filename
------                                                    --------
VMName                                             [SAN] VMName/vmdk-name.vmdk
VMName                                             [SAN] VMName/vmdk-name_1.vmdk
VMName                                             [SAN] VMName/vmdk-name_2.vmdk

Monday, 21 December 2015

Check To See If Folder Or File Is Present On A Remote Server

I needed to check for an installed program on a number of remote servers without having to log in to each one individually. Unfortunately, whilst the program is listed in Control Panel > Add / Remove Programs, it does not get returned via Powershell when running;

Get-WMIObject Win32_Product

Running the following script allowed me to import a list of servers then search for a file or folder on those servers. Following the search the server name and result of the search is outputted to the screen;

#Import list of servers
$cns = Get-Content "C:\Users\LangridgeJ\Desktop\list-of-servers.txt"
#Scan for selected file or folder
foreach ($cn in $cns)
{$path = Test-Path "\\$cn\C$\Path\To\Folder\Or\File"
#Write output to screen
If ($path -eq $true ) { Write-Host $cn 'Files or folders are present' }   
        Else { Write-Host $cn 'No files or folders are present' } }

Friday, 18 December 2015

No "Continue To This Website" Option On HTTPS Site

I recently had an issue with an internal website with no certificate. When trying to access the site via IE10 I was not being given an option to "Continue to this website". This was due to a change Microsoft made blocking the use of RSA certificates with keys less than 1024 bits long.

Microsoft's Security Advisory bulletin can be found here: https://support.microsoft.com/en-us/kb/2661254

To fix this, run CMD as administrator and submit the following command;

certutil -setreg chain\MinRSAPubKeyBitLength 512

Then refresh the page. The "Continue to this website" option should be available again.

Wednesday, 16 December 2015

AWS RedShift Cluster Can Only Be Launched In Default VPC

When trying to launch a RedShift cluster in AWS I found I was only able to select the default VPC - unfortunately not the VPC that my Production workloads were running in.

In order to allow the creation of RedShift clusters in VPCs other than your default you need to create a new Cluster Subnet Group. To do this follow the steps below;

1. Login to AWS console and select RedShift
2. In the RedShift console go to "Security" and select "Subnet Groups" from the tabs at the top
3. Click "Create Cluster Subnet Group"
4. Give the group a name and description and pick the VPC you want to run the Cluster in. Then choose your Subnet IDs from the Availability Zones available.
5. Click "Create". Now when you try to launch a RedShift cluster you will be able to choose the VPC you want to run the Cluster in, and your newly created Subnet Group.

Wednesday, 11 November 2015

Accessing Shares: "The account is not authorized to login from this station"

When trying to connect to an admin share (\\Servername\D$) I was seeing the error "The account is not authorized to login from this station"

This is due to an issue with SMB signing policies and can easily be fixed by ensuring the following keys have parameters as below;

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanworkstation\parameters

enablesecuritysignature = 1
requiresecuritysignature = 0 


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters

enablesecuritysignature = 1
requiresecuritysignature = 0 


In my case, I found that one of the lanmanworkstation keys did not match. After changing this I could access the admin share

Terminal Server Sessions Disabled

I ran into a couple of issues recently where I was no longer able to RDP onto a server. Whenever I tried to login I received an error "Terminal Server Sessions Disabled: Remote logins are currently disabled".

To fix this I opened up regedit, connected to the server in question by using the "Connect Network Registry" option (under "File" in regedit) and browsed to the following key;

HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\WinStationsDisabled

This was set to 1. I changed this to 0 and was able to login again.

Friday, 24 July 2015

Backup and Restore ESXi Host Configuration Data Using PowerCLI

To back up the configuration data for an ESXi host using the vSphere PowerCLI, run the command:

Get-VMHostFirmware -VMHost "ESXi_host_IP" -BackupConfiguration -DestinationPath "location"


To restore the data to an ESXi Host the build number of the new host must match the build number of the host that created the backup file. Then;

1. Put the new host into maintenance mode;

Set-VMHost -VMHost "ip" -State "Maintenance"

2. Restore the configuration;

Set-VMHostFirmware -VMHost "ip" -Restore -SourcePath "location of file from backup operation" -HostUser "username" -HostPassword "password"

3. Exit maintenance mode;

Set-VMHost -VMHost "ip" -State "Connected"

Monday, 20 July 2015

Where are my FSMO roles?

The easy way to query which servers hold your FSMO roles is to open a command prompt and type;

NetDOM /query FSMO

This should return a list of each role and the server holding it.

Tuesday, 9 June 2015

PowerCLI - Generating A Network Configuration Report

I needed to generate a report from my vSphere environment to detail the network configurations of my various Hosts including the DataCenter and Cluster that the Hosts belong to, as well as vSwitch configs, any active and standby NICs that were assigned, port group name, VLAN ID, device type (ie vmk port) and any IP assigned. I also wanted to export this information to CSV.

I did this is two parts.

1. Host to Cluster and DataCenter;
Get-VMHost | Select Name, @{N=”Cluster”;E={Get-Cluster -VMHost $_}},@{N=”Datacenter”;E={Get-Datacenter -VMHost $_}} | Export-csv c:\temp\inventory.csv

2. Network configuration info;
&{foreach($esx in Get-VMHost){
    $vNicTab = @{}
    $esx.ExtensionData.Config.Network.Vnic | %{
        $vNicTab.Add($_.Portgroup,$_)
    }
    foreach($vsw in (Get-VirtualSwitch -VMHost $esx)){
        foreach($pg in (Get-VirtualPortGroup -VirtualSwitch $vsw)){
            Select -InputObject $pg -Property @{N="ESX";E={$esx.name}},
                @{N="vSwitch";E={$vsw.Name}},
                @{N="Active NIC";E={[string]::Join(',',$vsw.ExtensionData.Spec.Policy.NicTeaming.NicOrder.ActiveNic)}},
                @{N="Standby NIC";E={[string]::Join(',',$vsw.ExtensionData.Spec.Policy.NicTeaming.NicOrder.StandbyNic)}},
                @{N="Portgroup";E={$pg.Name}},
                @{N="VLAN";E={$pg.VLanId}},
                @{N="Device";E={if($vNicTab.ContainsKey($pg.Name)){$vNicTab[$pg.Name].Device}}},
                @{N="IP";E={if($vNicTab.ContainsKey($pg.Name)){$vNicTab[$pg.Name].Spec.Ip.IpAddress}}}
        }
    }
}} | Export-Csv "c:\temp\report.csv" -NoTypeInformation -UseCulture

Wednesday, 20 May 2015

Call Forwarding On The Mitel 3300

We ran into some issues this morning when trying to set up call forwarding on a particular extension to an external number. Despite the Call Forwarding Profile for the extension being set to ALWAYS and the number entered correctly (with 9 for an outside line), calls were not being forwarded at all.

The fix for this was to create a speedcall for the external number, then to enter the new speedcall number in the Call Forwarding Profile. Instructions for doing this are as below;



Set up Speed Call:
  1. Login to your Mitel system.
  2. From the homepage navigate to the System Property - System Feature Settings - System Speed Call form.
  3. Click Add.
  4. When the window opens enter the new Speed Call details: 
      
    • Speed Call Number - XXX or XXXX (make the number of digits the same as your Extn digit length)
    • Enter the actual number -  (9) or the access code for an outgoing line on your system followed by mobile or landline number e.g. (9) 0778XXXXXXX or (9)011324XXXXX (9 then the full number)
    • Override T/C - Yes
    • Select S/C option 

      Speed Call - 450     Act No - 9078xxxxxx     Override - Yes     Select S/c
       

      This saves having to then change the Class Of Service for the phones and trunks with Override to Yes 

Set up a Call Forward Profile:
  1. Go to the User & devices - Advance Configuration - Call Forward Profile form.
  2. Click Add.
  3. When the window opens enter the new Call Forward details:
    • Number - xxx or xxxx (the extension that wants the calls forwarding)
    • Type - Always     
    • Fwd Dest - 450 (put in the speed call number you assigned in 4 above)
    • Turn on if testing

Program a button on the phone:
  1. Go to the User and Devices - User and Devices Configuration form.
  2. Highlight the extension that wants to Call Forward.
  3. Click Change.
  4. Once the extension page has loaded, click the Key tab.
  5. Highlight an unassigned key or a key that's not needed and click Change Key.
  6. When the window opens enter the new Key details: 
    • Label - write a label you'll understand (this will only show on phones with a screen)
    • Line Type - Call forward Always 

      Make sure it's the correct call forward type as selected above in Setting up a Call Forward Profile. 
  7. Click Save
  8. When complete, turn on Call Forward (the key should light up) and test.

Thursday, 14 May 2015

Nexenta 3.1.6-FP3/4.0.3 and vSphere 5.5

Systems check:
Nexenta 3.1.6-FP3
VMware ESXi 5.5.0

All LUNs are VMFS5 formatted

When attempting to upgrade to Nexenta 4.0.3 the other night I ran into an number of issues that ended with me carrying out a rollback to 3.1.6-FP3. A couple of notes from the problems I encountered;

1. As our log drive was a DDR card, we had to uninstall the device from the Pool as the driver had to be manually reinstalled once Nexenta had updated to 4.0.3.

2. After updating to 3.1.6-FP3, all of the mappings in SCSI Target Plus had been deleted so when I rescanned for storage it dropped all the connections.

3. 3.1.6-FP3 still caused me issues as none of our datastores (set up in 3.1.5) were visible despite the storage being mounted. I forced the datastores to be persistently mounted through the command line but obviously this was just a work-around rather than a solution. I did this by running the following commands;

esxcfg-volume -l (this generates a list of mounted storage on the host - I copied the UUID displayed for each LUN for the next step)
esxcfg-volume -M UUID (this persistantly mounted the datastore on the host)


These commands had to be carried out for each datastore on each host - not ideal!

4. After further investigation it appears that Nexenta have turned off Hardware Acceleration, not only in 4.0 but also in 3.1.6-FP3. I then connected to each host via the GUI and turned off the 3 settings related to this;

On the selected host go to the Configuration tab, then under Software go to Advanced Settings.
First go to DataMover and set both HardwareAcceleratedInit and HardwareAcceleratedMove to 0.

Then go to VMFS3 and set HardwareAcceleratedLocking to 0.

Changing these settings do not require a reboot.

Once this is done, you also need to turn off Hardware Acceleration on the LUNs themselves.

You only need to run this command on one one of the hosts that has the datastore attached. Running a rescan of datastores after making this change will update the datastore on all the hosts, allowing you to add the storage.

As per VMware's KB article HERE follow the steps below to disable ATSOnly on the LUN. Be aware that the command appears to be case sensitive - I typed ATSonly rather than ATSOnly and it failed to execute;


  1. Connect to one of the hosts sharing the VMFS5 datastore with an SSH session. For more information, see
  2. Run the following command:

    vmkfstools --configATSOnly 0 /vmfs/devices/disks/device-ID:Partition

    Where:

    device-ID is the NAA ID of the LUN on which the VMFS5 datastore was created.
    Partition is the partition number on which VMFS5 datastore was created. This is usually 1.

    For example:

    vmkfstools --configATSOnly 0 /vmfs/devices/disks/naa.6006016055711d00cef95e65664ee011:1

    Note: It is sufficient to run this command on one of the hosts sharing the VMFS5 datastore. Other hosts automatically recognize the change.
  3. Run the following command to rescan for datastores:

    esxcli storage filesystem rescan
  4. The VMFS5 datastore should now mount successfully.
Alternatively, rather than running the command at step 3, just rescan the datastores from within vSphere Client.

As a further note on disabling ATSOnly if you are using datastore heartbeating for HA, remember to turn this off for the datastore you are altering otherwise the disk will always show as being in use, even with it's VMs powered off.

Friday, 17 April 2015

Exchange 2010 - Viewing Mailbox Sizes

Get-MailboxStatistics -Server “Server Name” | Sort -Property TotalItemsize | Select DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime | Export-CSV mailboxes.csv
Running this command in Exchange Management Shell will generate a CSV file containing mailbox information for your Exchange server, display sizes in MB and sort the results from smallest to largest.

This command can be adapted to display information from a database rather than server, or for an individual user by changing the -Server “Server Name parameter to;

-Database "Database Name"
or
-Identity "Username"

You can also specify other parameters to display in the CSV report;

AssociatedItemCount
DatabaseName
DeletedItemCount
DisconnectDate
DisplayName
ItemCount
LastLoggedOnUserAccount
LastLogoffTime
LastLogonTime
LegacyDN
MailboxGuid
ServerName
StorageGroupName
StorageLimitStatus
TotalDeletedItemSize
TotalItemSize

Tuesday, 3 March 2015

VMware Update Manager Scheduled Tasks Stuck On Queued

VMware Update Manager = Windows Server 2008 R2
vCenter = vCenter Server Appliance


Over the last couple of days I've been investigating an issue where VMware Update Manager tasks - "Check new notifications" and "Download patch definitions" complete OK when manually run, but sit in the task pane as "Queued" when run through the scheduled task.

Hunting around online for a solution only provided me with a way to clear the tasks, not to actually fix the issue (for reference, this is to restart the VMware vSphere Update Manager Service on the vUM server).

After investigation, the queuing issue appears to be due to permissions problems. The services on vUM were running as Local System account. I changed this to an account with permissions in vCenter - in this case the Update Manager domain account I had created - and re-ran the scheduled task. The task now completed successfully each time.

After changing the account remember to restart the service for the change to take effect.

Friday, 6 February 2015

Thursday, 5 February 2015

Image Renditions In Sharepoint 2013

A useful resource explaining how to enable Image Renditions in Sharepoint 2013. I used this for resizing photographs for a contact list;

http://sharepoint.rackspace.com/how-to-change-image-size-and-shape-in-sharepoint

Change The Size Of Promoted Links In Sharepoint 2013

The Promoted Links in Sharepoint 2013 are fantastic but at 150x150 pixels are way to big for use. The following script reduces the size of the tiles to a more reasonable 100x100. Place it inside a Script Editor Web Part on the same page that your Promoted Links are displayed on;


 <style type="text/css" unselectable="on">
            div.ms-promlink-body {
                height: 100px;
            }

            div.ms-tileview-tile-root {
                height: 110px !important;
                width: 110px !important;
            }

            div.ms-tileview-tile-content, div.ms-tileview-tile-detailsBox,  div.ms-tileview-tile-content > a > div > span {
                height: 100px !important;
                width: 100px !important;
            }

            div.ms-tileview-tile-content > a > div > img {
                max-width: 100%;
                width: 100% !important;
            }

            ul.ms-tileview-tile-detailsListMedium {
                height: 100px;
                padding: 0;
            }

            li.ms-tileview-tile-descriptionMedium {
                font-size: 11px;
                line-height: 16px;
            }

            div.ms-tileview-tile-titleTextMediumExpanded, div.ms-tileview-tile-titleTextLargeCollapsed, div.ms-tileview-tile-titleTextLargeExpanded {
                padding: 3px;
            }

            div.ms-tileview-tile-titleTextMediumCollapsed {
                background: none repeat scroll 0 0 #002E4F;
                font-size: 12px;
                line-height: 16px;
                min-height: 36px;
                min-width: 97px;
                padding-left: 3px;
                position: absolute;
                top: -36px;
            }

            li.ms-tileview-tile-descriptionMedium {
                font-size: 11px;
                line-height: 14px;
                padding: 3px;
            }

 .ms-tileview-tile-content img{width:100px!important; height:100px!important;} 

</style>
The div.ms-tileview-tile-root value should be set to slightly more than the tile size so as to preserve a border.