Monday, July 15, 2013

Essential Command-Line Tools for Managing Active Directory

Windows Server 2008 R2 includes several tools that let you manage Active Directory from the command line. Here’s a look at the key tools and what they do.

Adprep Prepares a Windows forest or domain for installation of Windows domain controllers (DCs). To prepare a forest or a domain, use adprep /forestprep and adprep /domainprep, respectively. (Note that for Windows Server 2003 SP1 or later, a domain’s Group Policy isn’t automatically updated. To prepare Group Policy for the domain, you must use the command adprep /domainprep /gpprep. This modifies the access control entries (ACEs) for all Group Policy object (GPO) folders in the SYSVOL directory to grant read access to all enterprise domain controllers. This level of access is required to support RSoP for site-based policy. Because this security change causes the NT File Replication Service (NTFRS) to resend all GPOs to all domain controllers, you should use adprep /domainprep /gpprep only after careful planning.)

Dsadd Adds computers, contacts, groups, organizational units, and users to Active Directory. Type dsadd objectname /? at a command prompt to display help information about using the command, such as dsadd computer /?.

Dsget Displays properties of computers, contacts, groups, organizational units, users, sites, subnets, and servers registered in Active Directory. Type dsget objectname /? at a command prompt to display help information about using the command, such as dsget subnet /?.

Dsmod Modifies properties of computers, contacts, groups, organizational units, users, and servers that exist in Active Directory. Type dsmod objectname /? at a command prompt to display help information about using the command, such as dsmod server /?.

Dsmove Moves a single object to a new location within a single domain or renames the object without moving it. Type dsmove /? at a command prompt to display help information about using the command.

Dsquery Uses search criteria to find computers, contacts, groups, organizational units, users, sites, subnets, and servers in Active Directory. Type dsquery /? at a command prompt to display help information about using the command.

Dsrm Removes objects from Active Directory. Type dsrm /? at a command prompt to display help information about using the command.

Ntdsutil Allows the user to view site, domain, and server information; manage operations masters; and perform database maintenance of Active Directory. Type ntdsutil /? at a command prompt to display help information about using the command.

Saturday, July 6, 2013

SQLa0000.tmp file rapidly increases

We have noticed recently that there is a temp file in C:\windows\temp called sqla0000.tmp (c:\windows\temp\sqla0000.tmp) that continuously grows over time until it completely fills the hard drive.  It seems that the file grows gradually and then on one day it balloons to fill the entire hard drive.

 This file is associated with Symantec Endpoint Manager as you need to stop the SEPM service to delete it.

I noticed that if I restart my Symantec Embedded Database service, the file shrinks tremendously. However, I have had to do this 2 times in the past 3 months.

qla000.tmp file is consuming hard drive space


http://www.symantec.com/business/support/index?page=content&id=TECH188303

Automatically Clean Up Temporary ASP.NET Files

The Problem

One of the test environments I help maintain is subject to dynamic and regular changes in .NET applications. The development team are constantly releasing new builds that are slightly different.
You may not be aware that .NET applications go through a compilation process when they first start up. I’ve also been told on application pool recycle however I haven’t confirmed this. However, after the application has been removed or updated, the compilation temporary files remain. On a test environment similar to my above scenario, a total of 50GB of disk space can be easily wasted, doing nothing. So if you’re in a similar scenario, you may need to routinely clean up these files.
I know of four locations where these files can build up:
  • C:\Windows\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files
  • C:\Windows\Microsoft.NET\Framework64\v1.1.4322\Temporary ASP.NET Files
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
  • C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files
  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
If you application pools run in 64bit mode, you’ll find the “Framework64″ locations more applicable. If your application pools use 32bit mode, you’ll need to consider the “Framework” locations.

A Few Notes

A reminder that files in these locations are normal. Don’t go over the top trying to clean them up.
It should be noted that while the files are in use by the web server, you will not be able to delete them – this is fine; the goal is to clean up unused files.
You should also be aware the next time the application fires up, on app pool start, the application will re-compile again. This may lead to a longer than average initial page load. If this is of concern, consider only removing files that are older than 30 days.
Of course, this script is provided as is. You should test it thoroughly in a test environment before use in production (though I certainly do).