Thursday, 19 April 2012

Issue with scripts\scheduled tasks on Server 2008 that use Excel or Office I had a problem yesterday scheduling a task to get some data and create an excel file on 2008 R2 Server L1UKASP26. The script ran perfectly on my PC, and also ran perfectly on the server if you double clicked it, but didn't run as a scheduled task. After troubleshooting the task settings, I worked out that it would work if you selected "Run only when user is logged on" (so like "Interact with the desktop" in previous Windows versions), but fail if you selected "Run whether user is logged on or not". After a while searching for ways around this, I came across the below article, which basically says that Office apps need a %profile%\desktop folder to work, and when running in 'headless' mode with 2008 Server, there isn't one. The fix, they said, is to create a couple of empty desktop folders. Surprisingly, this fixed it! If I had used Sysinternals process monitor (http://live.sysinternals.com/procmon.exe) to look for failed file accesses, I might have worked this out myself ;*)

Wednesday, 18 April 2012

Installing DotNet 3.5 on Windows 8


One issue I've had with Windows 8 on my Acer W500 is that some apps I want
to run (like the VMWare vSphere client, and the MCITP Test Simulator) want
DotNet 3.5 installed. Using the Add Windows Features GUI always bombs out
with
A slightly-deeper-than-usual session with Google revealed this gem - due
to known bugs in Windows 8 Consumer Preview, you have to use the below CLI
command;

Dism /online /enable-feature /featurename:NetFX3 /All /Source:DVDLOCATION:\sources\SxS /LimitAccess

Don't forget to reboot, then run Windows Update ;)
Cryptic error when exporting VMs in Windows 8 Hyper V (originally composed March 2012)

I recently had an interesting issue with Hyper V in Windows 8 Consumer
Preview (running fantastically on my Acer W500 tablet without any
additional drivers, available from £350 online). As the laptop only has a
32GB internal hard drive and I wanted to run a few VMs for
testing\learning, I needed more room. The SSD hard drive is upgradeable
according to the W500 community, but I didn't want to spend £120ish on a
128GB SSD right now, so spent £22 on a 32GB Class 10 SD card instead (from
play.com).
When moving my VM onto to SD card from Hyper V Manager, I got the a cryptic error. Same issue and error with exporting the VM. I was also unable to copy and
paste the folder using Windows Explorer, getting a differently worded error. I checked the card
was ok by filling it up with several copies of the photos and movies I had
on the W500. These copied fine (getting a fairly steady 12MBs write rate
BTW), so I knew I didn't have what looked like a 32G card but was actually a much smaller card.
It was then that I had my brainwave - if Windows Explorer can't copy the
files but the media is OK, maybe the files themselves have extra
properties or attributes which cannot be written to the card. I
immediately thought of NTFS extended attributes, and realised that the SD card
would have been formatted with FAT by default. I re-formatted the card
with NTFS and this fixed the issue :)
Searching AD for manually created replication links (Originally composed July 2011)

During recent AD troubleshooting by colleagues whilst I was on holiday,
several manual replication links were created. I came up with the below
method to determine manual links in the forest.



Click Start, Run, ldp.exe (get support tools for your OS if not present,
should be on any DC).

Click Connection, Connect, then enter the name of any DC, performance
will be better if its in your site.

Click Connection, Bind, then use currently logged in user even if you
the account doesn't have Domain\Enterprise Admin - only Domain User
rights are required.

Click Browse, then Search.

Enter the Base DN as a the DN of any of your forest domains i.e.
dc=domain01,dc=local or dc=London,dc=rootdomain,dc=local

Enter the filter as objectclass=ntdsconnection

Set the scope to Subtree

Enter the attributes as ms-ds-replicatesncreason

Click Run

Examine the output for any one liners i.e.



The below is NOT manually created as it DOES have a
mS-DS-ReplicatesNCReason value;

Dn: CN=9a9e3868-bc17-456a-891c-cc2dda1829ba,CN=NTDS
Settings,CN=GWDINFR04,CN=Servers,CN=Singapore-DR,CN=Sites,CN=Configurati
on,DC=manfinancial,DC=net

mS-DS-ReplicatesNCReason (7):
B:8:00000060:CN=Configuration,DC=manfinancial,DC=net;
B:8:00000060:DC=intldn,DC=manfinancial,DC=net;
B:8:00000060:DC=tteurope,DC=manfinancial,DC=net;
B:8:00000060:DC=can,DC=manfinancial,DC=net;
B:8:00000060:DC=manchg01,DC=manfinancial,DC=net;
B:8:00000060:DC=manny01,DC=manfinancial,DC=net;
B:8:00000060:DC=ForestDnsZones,DC=manfinancial,DC=net;

whenChanged: 06/05/2011 21:31:35 GMT Daylight Time;

whenCreated: 06/05/2011 21:22:08 GMT Daylight Time;



The below IS manually created as it DOES NOT have a
mS-DS-ReplicatesNCReason value;

Dn: CN=NYWPCORE01,CN=NTDS
Settings,CN=LWPCORE03,CN=Servers,CN=London-IX-Servers,CN=Sites,CN=Config
uration,DC=manfinancial,DC=net

whenChanged: 07/05/2011 16:42:53 GMT Daylight Time;

whenCreated: 07/05/2011 16:38:04 GMT Daylight Time;



If you with to further examine, or delete, the manually created links
in, for example, dssite.msc aka "Active Directory Sites and Services",
you will need to work out which DC object contains the replication link.
This can be worked out by looking at the third, fourth and fifth "CN="
statements i.e. in the below entry, you'd need to browse to the Site
London-IX-Servers (fifth "CN=" value), then expand Servers (fourth "CN="
value), then expand the server LWPCORE03 (third "CN=" value) - you'll
need to expand the NTDS Settings container to see the replication
object. If you are thinking of deleting it, I'd first RDP on to both
servers involved and ensure that a "repadmin