Showing posts with label Windows Server 2008R2. Show all posts
Showing posts with label Windows Server 2008R2. Show all posts

Wednesday, 22 October 2014

Shutting a Windows Server down without installing updates

 

If you have ever needed to shut down a server but it wants to install updates which you know will take longer than your service window you can use the following command to prevent the issue until you reboot.

 

net stop wuauserv

 

This will stop the Windows Update Service (at least until you reboot)

 

Hope this helps someone

Friday, 27 June 2014

DNS Cleanup - Setup Scavenging - Properly

Importance of DNS

DNS is arguably the most important aspect of any network.

Incorrect setup, errors and old records can significantly affect performance and since a lot of third party applications such as antiviruses, remote support use it,  as well as all windows server roles and system center products it is fairly important.

If DNS fails, everything else will.  Trust me, trust all IT Admins, when it goes down, brown trousers are a guarantee.

Multiple ISPs, I know for one Ja.net, do offer backup name servers and automatic fail-over, so in the event that your DNS does fail, at least you know you have an offsite copy somewhere. Janet DNS Services

Is there something wrong with mine?

Now if you work in a single establishment and have performed multiple migrations of your network, I can guarantee (since you are reading this) you probably looked at your DNS and realise.. wait there are machines in here which haven't existed for years.. why haven't they gone.  Scavenging is set.

This also applies for new networks as well which have been going for a couple years or so.  It doesn't take long for a network to get quite dirty.

You gotta love GUI...not.  This is why we should all be on Core editions people! If you are a Doctor Who fan, you know the Doctor Lies, a GUI lies to.

Yes you have a tick box and yes you've specified the day to scavenge records, but have you also noticed that when you scavenge manually.. they still stay there.. now isn't that just weird.

Is there something wrong with your DNS, well no, because your network is working, but yes because it isn't working as well as it could be.

Lets Tidy Up.

Active Directory Domain Services

First and foremost since you are doing all this cleaning, it might be worth just re-looking at your Active Directory.

At my college, yes I have a accurate asset register, but there is that part of me thinking, is it possible that this random computer is still being used by someone.  Why is it in AD if it isnt?

If unsure, disable it and wait for the phone to ring, enabling it takes all of 5 seconds to fix the issue.  Cleaning up AD can make your life so much easier as when running through the DNS records you can then say, hand on heart, that machine shouldn't be in there, it doesn't exist anymore.

After a set period of time (48hours to 2 weeks), if you can say well no one has called and all staff full time and part time have been in since then, then you can delete it properly from Active Directory.  I genuinely disabled about 40 machines when I first started here.  How else am I going to find out?  People are quick to report issues when they can't login, plus makes you feel in control, they need to be reminded of this. :)

DNS

Now you can say AD is up to date and accurate, lets start sorting out DNS.

You will need to perform the following actions on every DNS server in your organisation, don't listen to the myths of it replicating, thats Microsoft pretending that everything is perfect.  When it comes to settings, just pretend nothing like that works and manually check.  Sometimes it does replicate and i'm sure the settings do after X amount of time, but I haven't got time to sit with fingers crossed.

Saying that, there is a moment, where you just need to wait, some things cannot be rushed.. Trust me on this.

Regardless if you use RSAT or login to your server remotely/directly, you need to open DNS (shock)

Add in ALL your DNS Servers, so you can just do it all from one place.

Right click your first server and choose Set Aging/Scavenging for All Zones.



On the Menu, choose the tick box and set a time for your scavenging, best practice is 7 days.  For a school I like 5. (I did this on a Monday, so now mine refreshes the weekend).


Press Ok.

Right click the server again and choose properties.

On the Advanced Tab, ensure "Enable automatic Scavenging of Stale Records" is ticked and you specify the identical number of days you specified above.


Press Ok. 

Right, open up forward lookup zones, choose your domain, right click Properties.


Choose the aging button on the General Tab.



Set this to the same time as what you have done before.

*this is not best best practice and in a very large enterprise environment, you wouldn't set these times all the same (hence why it isn't set from the top level).  In a school single forest, single site, hell even a double site, this is not going to cause any problems. University level, maybe you need to plan this out a bit more, but at that level frankly if your technicians and administrators have a bad DNS then what the hell are you doing. 

Press Ok to the Aging and press ok to the properties menu.

If you have a second DNS Server then do all the process again for your second one.

If you have more than 2 DNS Servers however, do the complete opposite. Turn OFF DNS scavenging in every menu specified above. In this case it is best to have one server handling all the scavenging.

Command Line Stuff

Login to your primary DNS Server.

If you have two DNS Servers:

Go to CMD as Administrator

Type in DNSCmd . /ZoneResetScavengeServers [Domain] [DNSServerIP] [SecondDNSServerIP]

e.g. DNSCmd . /ZoneResetScavengeServers contoso.local 192.168.10.10 192.168.10.11

If you have more than two DNS Servers, ensure all servers, except your primary, have scavenging turned off and type in the same command minus the [SecondDNSServerIP]. So.

DNSCmd . /ZoneResetScavengeServers contoso.local 192.168.10.10

What will happen now

New scavenge servers:
        Ptr          = bunchofnumbers
        MaxCount     = 2
        AddrCount    = 2
        server[0] => gobbledeegook, addr=192.168.10.10
        server[1] => gobbledeegook, addr=192.168.10.11

Reset scavenging servers on zone [domain] successfully.


Command completed successfully.

You will notice that once you have typed in what you need to the list of scavenging servers is now setup successfully. You might have 2 in the list, or just 1 depending on your setup.

The waiting game begins.

Patience

This will take several weeks to finally sort itself out.  The reason being is that machines that joined before you set this all up are setup on a different timestamps to what you specified as well as other things as well and other than manually deleting them, just hold fire and wait.

After a few weeks you'll begin to notice that your scavenging is actually working now.  No odd devices are appearing in your DNS.

Roles such as WSUS will begin to actually clean itself up when you click clean, things like system center client deployments will work much faster.  Antivirus logs become more accurate, server resolution is significantly quicker and the clients will begin to notice some speed improvements, though they won't ever say anything.  Login times usually improve as well and you'll probably find that group policies that are set but haven't applied correctly start to apply oh and DFS begins to love you again.

I hope this blog has helped out a lot of people out there, I know my life became so much easier once I got the DNS stuff out the way. My DNS is neat, my AD is neat and there is no sign of old devices from previous migrations.  Ready for the future.


Thanks for reading!

Tuesday, 25 September 2012

No Policies Applying, Temporary Login, Windows 7

No Policies Applying, Temporary Login, Windows 7 x64/x86

You have been logged in with a temporary profile..  even though the user in Active Directory (AD) is setup correctly and the NTFS/Share permissions are also.. setup correctly.

Whats going on? Hopefully this post will help.

Applies to: Windows 7 x86/x64, Windows 2008R2 Domain

Symptoms

  • No Group Policies have applied to the profile
  • No Mapped Drives/Printers
  • No Preferences Applying
  • Admin (like) control of the machine, no restrictions set
  • An explanation mark (!) in a blue circle appears in the system tray
  • A balloon appears/tries to appear notifying the user that they are logged in with a temporary profile
  • The login is way too quick.
  • If you log out and log back in sometimes the profile works fine, sometimes it logs back in again as a temporary profile. 
  • The issue is intermittent with little/no pattern, sometimes does it, sometimes it does not. Not machine specific, not user specific.
  • If you wait for a few seconds before logging in, the chances of the profile working correctly improves.
  • Occurs more often on wireless devices than wired, but isn't limited to wireless.



Reasons

When Windows 7 was the new big thing, Microsoft had a page about all the cool new features of their brand new operating system.  There was one feature (which unfortunately I have forgotten the name of) but it boasted about priority, fast logins.  Essentially, it meant that if Windows 7 noticed there would be a delay in the logging in, it chose to prioritise just getting the user to the desktop rather than waiting to ensure the login was correctly done.

This is what you are encountering.  Some networks, particularily wireless ones take that little bit longer to establish a new IP address, down to poor signal strength or just generally the type of wireless card you have in your device.

So when a typical user, types in their username and password within seconds of the machine first booting, the chances are the computer hasn't yet got an IP address or stable connection with the server but still attempts to log them in regardless.  Windows 7, realising that there is a networking issue, rather than saying to the user, "Please wait a sec, I haven't fully established a trust with the server", it simply goes, "oh who needs a server, I know your credentials are correct, thats all I basically need, heres a desktop", perfect if you are a home user, really annoying if they are domain user.

Resolutions

Nice and Easy, theres a group policy for it.  Inside that needle in a haystack database there is a policy that ensures the computer (regardless of whether its wireless or not) will make sure the user will not be able to login until a stable connection is first established.

Located Here

Windows Server 2008R2
Computer Configuration -- Policies -- Administrative Templates -- System --  Logon

Windows Server 2003R2
Computer Configuration -- Administrative Templates -- System -- Logon

Policy Name

Always Wait For The Network At Computer Startup And Logon

Set to: Enable



How it works

This is a brilliant policy when applied as it ensures that when a computer is loading up and a user attempts to login the second they can type, it overrides the client operating system's decision to prioritise getting the user to the desktop. 

All policies will therefore come down to the client and apply to the user and computer, thus ensuring that their logins are correctly redirected and their resources (shared areas and Printers) are correctly applied in accordence to your ICT policy.



I hope this helps you all out, I understand that Windows 8 is out soon but for those looking to upgrade to Windows 7, this is a small bug i'm sure you will come across.

It is easy to ignore when testing as when it happens you log off and you log back in and it all seems fine, but bear in mind, you are a technician, you use computers in the way they should be used.  True testing comes from the end user and not the ICT department.

I'm happy to help out anyone with any more issues in relation to this, just leave a comment below.  Additionally, any other fancy features you may of found in the GPO Needle in a haystack database, which you feel will help optimise Windows 7's logging in speed and/or reliability, never hesitate to post a comment, we are all on the same team here, all help is much appreciated.

Speak to you all soon,

The ITMagician