Tuesday 30 July 2013

Fully Disable UAC in Windows 7 via Group Policy GPO


GPO can be a tricky beast. Even when you think you've disabled by moving the slider in the GUI down to zero, turns out it still runs. Although it's not best practice by any means, it is possible to totally disable UAC through the application of a Group Policy Preference to the Computer Configuration. It's worth noting that you best have a rock solid need to do this since fuilly disabling UAC can leave you much more open to malicious mischief.
 
>Open GPO
 
>Create a new GPO or Edit an exisiting one
 
>Drill down to
Computer Configuration > Preferences > Windows Settings > Registry
 
>RC on the Registry and choose New > Registry Item
 
>The New Registry Properties window will pop up

>Select the browse button next to the Key Path section (the small box with "...." in it)

>Drill down to the following locaiton:
HKLM\Software\Microsoft\Windows\Current Version\Policies\System
Select the EnableLUA key
Then set the Value Data to 0 (default setting is 1)
 
>OK the New Registry Properties dialogue box and then exit the Group Policy Editor
 
Your new/amended policy can then be linked to the OU containing the clients. If you only need to apply it to certain machines then you can add those machine names under the Security Filtering window by clicking on Add...

Monday 29 July 2013

Windows Setup could not configure Windows on this computer’s hardware - Windows 7 Build Fail

When building a windows 7 machine you may encounter the following error message mid way through the execution of the Task Sequence:

"Windows Setup could not configure Windows on this computer’s hardware"

According to the good folk over at Microsoft, this error is a result of: "an issue with the Intel storage controller driver that's included in the released versions of Windows 7 and of Windows Server 2008 R2."

The most straight forward way to resolve this issue is to do the following:

A]
  • Change the BIOS hard disk drive setting to AHCI or IDE

If, for whatever reason, you are unable to change the BIOS setting, you can also download the actual driver for the hard disk and then incorporate it as part of the build process. The below steps were cribbed from the MS website:

B]
  • Go to another computer with an internet connection and click the following link to locate the driver for your hard disk drive (either 32-bit or 64-bit): http://www.intel.com/support/chipsets/imsm/sb/CS-031502.htm
  • Once downloaded, put the file onto a DVD or USB flash drive or an external hard drive that can be taken to the PC that you're installing Windows to.
  • Then start the installation of Windows 7 or Windows Server 2008 R2 and watch for the Load Driver option. You will see this option on the Where do you want to install Windows? screen in the lower right corner.
  • Connect the USB flash or external drive to the computerthat you're installing Windows or take the Windows DVD out of the drive and put the driver DVD into the drive. (You will put the Windows DVD back into that drive after the driver is loaded)
  • Click Load Driver, (clicking this option checks removable media for storage controller drivers)
  • Once the driver is loaded, continue with the Windows setup.

Tuesday 23 July 2013

Cookies in Windows 7

In windows 7 Microsoft helpfully opted to stash cookies in a bit of an out-the-way location which can make hunting them all down rather tricky. The best places to look are as follows:

Quick Access
Type shell:cookies into start/search and hit Enter

File Path Approach
C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Cookies

You'll need to enable 'view hidden folders' in the Control Panel in order to access the AppData folder.

Friday 19 July 2013

Bulk import Users into AD from csv file

If you ever need to import a number of users into Active Directory, often the quickest and easiest way to do this is by using a csv file. If you can compile all the user's information into a csv file then importing that info into Active Directory is fairly straightforward if you use a bit of Powershell. This is a pretty basic example but it can always be tweaked to include more elements.

Part1:
Create a basic csv file which contains the info you need. In this example all we know about the users is their first and last name and what we want to set their password to. Thus our csv file looks like this:

name,firstname,Password
user1,robot,Passw0rd
user2,robot,Passw0rd
user3,robot,Passw0rd
user4,robot,Passw0rd
user5,robot,Passw0rd
user6,robot,Passw0rd
user7,robot,Passw0rd
user8,robot,Passw0rd
user9,robot,Passw0rd
user10,robot,Passw0rd

Be sure to save it as csv file and call it something simple, such as newusers.csv. Save it somewhere that is easy to access (C:\temp for example)

Part 2:
open notepad and paste the below info in.

Import-Module ActiveDirectory
$Users = Import-Csv -Delimiter "," -Path ".\newusers.csv"
foreach ($User in $Users)
{
$OU = "OU=RobotWorkers,OU=All Users,DC=rob,DC=local"
$Description = "Standard Robot User Account"
$Office = "Robotopolis City"
$Password = $User.password
$Detailedname = $User.name + "," + $User.firstname
$UserFirstname = $User.Firstname
$FirstLetterFirstname = $UserFirstname.substring(0,1)
$SAM = $FirstLetterFirstname + $User.name

New-ADUser -Name $Detailedname -SamAccountName $SAM -UserPrincipalName $SAM -DisplayName $Detailedname -Office $Office -Description $Description -GivenName $user.firstname -Surname $user.name -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -Path $OU
}

You need to check three things before you save the file,
1:that the delimiter is correct (open the csv file in notepad, are the words separated by commas?)
2:that the name of the .csv file is correct
3:that the OU it will create the user accounts in is correct

Once you've confirmed all of the above, click save. In the Save window navigate to the same folder as you saved the newusers.csv file (in this example that would be c:\temp), change the file type to All Files and call it something simple like newusersscript.ps1. Be sure to give it a PS1 extension!

Then open up Powershell, navgiate to the folder containing the files,

[PS] C:\users\adminbot> cd c:\temp <hit return>

Next you need to execute the script file but make sure to prefix it with .\

[PS] c:\temp> .\newusersscript.ps1 <hit return>

The powershell script should then run and populate AD with the new user accounts. With a bit of luck some new accounts will pop up in AD:




Monday 15 July 2013

Change how long reports are kept for in NetBackup

Issue:
In Net Backup you need to change the retention period for reports in Net Backup. By default the logs are kept for 28 days but you can increase the based on your requirement.

Resolution:
GUI--> Host properties---> Master server ---> clean up
 
From the clean up dialogue box you can choose how long you want the retention period to be for the reports in Net Backup

Obviously it is worth noting that the longer you keep logs for the more potential there is for performance to be impacted. There is always the option of doing one of the following in the event that you find performance to be unacceptably slow:

1) archive the logs from master and restore and generate reports when ever required.

2) use a reporting tool

Friday 5 July 2013

Remote Connection/Ping to Hyper-V Machines Keeps Dropping Out

Problem: a new virtual machine had been created in our virtual environment. After a day or so it suddenly stops accepting RDP connections. It cannot be pinged and the only way to log on is to log on as Local Admin via the Virtual Machine Manager console. To all intensive purposes it appears to be off the network. At the same time a much older VM also started experiencing the same issue.

Temporary Solution: Rebooting the machine apparently fixes\resolves the issue....for a while

Permanent Solution: Check the ip address/MAC address for conflicts with other VM machines. If there is a conflict in one of these areas, rebooting will work for a bit but as soon as the network detects that there is a conflict between two ip addresses or MAC address it will take down one of the machines.

After further investigation it turned out that both machines were built from the same template which in spite of having been set to Dynamically generate a MAC address had resulted in two machines getting the exact same MAC address. A small gotcha but one which can be a bit of a pain to troubleshoot.

Wednesday 3 July 2013

Quick ways to Clear Up Space on Desktops/Servers

Running out of space is a fairly common problem, especially if the machine in question is running space intensive applications like Net Backup or SQL. If you ever need a quick way of freeing up some space, it's worth giving these a shot:

Delete Old MS Patch Ghost Files
Enable View Hidden Folders in Folder Options in Control Panel
Go to c:\windows
If you see a large number of ghost folders with names like $NTUninstallKB32451345$ then you can delete these folder to free up some space

Clear Down the Event Logs
Events Logs can fill up pretty quick since they're being written to almost non-stop. Each log can take up a couple of hundred MBs if it starts getting full so regularly clearing them down can help save space.
To clear down a log simply right click on it and select Clear Log...
You should be met with a message suggesting you save the log somewhere before clearing it out. This can be useful if you think you'll ever need to refer back to it in the future
Move the Page File
This is the area of space the machine will use if the RAM is full. If you need to free up some space on your C: drive moving it to another drive (if there's one avaiable) or simply setting it to "No Paging File" (though this can be risky). You can find the Page File info at the following locaiton:

My Computer à RC à Properties à Advanced à Performance à Advanced à Virtual Memory:Change
 
Other Basic Things to Check
Empty Recycle Bin
Run a Disk Cleanup on the drive
Check the temp folder on C: drive
 
If none of this helps, it might be worth downloading a directory space analyist such as Treesize (http://www.jam-software.com/freeware/) which will trundle off and find out what files/folders are taking up what amount of space on the drive.