Skip to main content

Posts

Disable local policies

For those of you who have taken classes with me that involve Group Policy, you know the warnings that I have given about not using local policy.  Well, here is a link to an article at Microsoft that shows you how to disable them.  I would look at doing this to your deployment image since it is a one-to-one operation. http://technet.microsoft.com/en-us/library/cc730760.aspx

How to delegate out permissions to rename user accounts

This question came from one of my Active Directory classes. To find the solution, I installed RSAT on a Windows 8 client.  I also created a user named JYoder who is not a member of any special group. I also had to do a little bit of detective work to figure out a small piece of this puzzle. The first real big problem is that I noticed the Last Name field is missing from the Delegate Control Wizard. We are missing the SN attribute which is the last name.  Here is where the fun starts.  On the client that you are using to delegate rights, Open dssec.dat   You will find it in %Systemroot%\System32 .  Make a copy of this first and then open it in Notepad. Now, scroll close to the bottom.  You will notice that the file is divided into object types.  Close to the bottom, you will find the User object.  Look for the SN field in the user object.  Make sure, you are in the user object. Now, look for SN=7.  Change this to SN=0.  Save the ...

How to copy a directory structure and all NTFS security attributes

This one was actually easier than I thought.  Robocopy seems to do a good job at this.  I created a folder structure that had empty folders and some NTFS permissions.  I called this folder that I wanted to copy Copytest.  I then executed this Robocopy command to make a copy of this folder structure on another hard drive. Robocopy e:\CopyTest c:\CopyTest /sec /mir The /SEC preserves the permissions and the /MIR creates a mirror of the original location on the destination.

Auditing Printers in Windows Server 2012

If your organization has a need for auditing the use of printers, you can accomplish this with the Windows Event Logs. Step 1: Configure Auditing. Auditing can be configured through several means.  Group Policy is the most effective because it is a centrally managed system and users are not able to turn it off.  To enable auditing on the client/servers where the printer is managed, scope a GPO with these settings: Expand Computer Configuration \ Policies \ Windows Settings Security Settings \ Local Policies \ Audit Policies . Configure Audit object access to log success. Close the GPO editor.  You must make sure that this GPO is scoped for the target client and the policy is applied.   Step 2: Configure audit settings on the printer. On your Windows 2012 or Windows 8 client, press the (Windows) key to bring up the start menu.  For Windows Server 2008/7, click Start . Type Printers and click Settings . Click Devices and Printers. Right click the p...

Add a bit of Control to Your PowerShell Code

Currently I am in the middle of writing a script that is exceeding 2500 lines of code.  Although I can keep the horizontal scrolling under control, the vertical scrolling is getting out of hand. The collapsible code functionality in the PowerShell V3 ISE really helps in keeping the scrolling down.  In the screenshot above, you can see those little “+” symbols on lines 164 and 201.  Notice the line numbers jump from 164 to 194.  This collapsible region was defined by the curly braces for this function.  Once I get a function completely debugged, I collapse it to make my scrolling easier.  In my current situation with 2500+ lines of code, collapsing every region each time I load the script in the ISE is a bit time consuming.  Here is a little secrete, press Ctrl M .  Take a look at my code now. Now I can selectively expand my code so I am only looking at what I need to look at.  This little trick will help reduce the frustration of vertical...

Installing Windows Server 2012 Hyper-V

Windows Server 2012 Hyper-V server is essentially Windows Server 2012 Server Core that is designed in only run Hyper-V.  You do not have to worry about purchasing a license for Hyper-V server.  The Host OS is free.  You do need to properly license any virtual machines (VMs) that you run on the Hyper-V server however. Setup is a breeze. It was, for the most part, just like installing Server Core.  It is also very fast.  Just download the installation software from Microsoft . For this deployment, I plugged a keyboard, mouse , and monitor into my target server so I can observe all the action.  Really, there is not much to watch once you get things started. Once the server starts up, you need to give it a password for the local administrator account. Then SCONFIG opens up.  Use SCONFIG with the following options to place this server in your domain and make it manageable. 8) Give this server a static IP address. 1) Add to the domain.  You can also...

How to speed up the time out process in PowerShell

While executing scripts against a large number of clients in your organization, you will undoubtedly encounter a few that are offline.  This causes your script to hang on each one.  This pesky little behavior can be mitigated in a variety of ways.  The function below is what I use when I need to run a script synchronously.  You simple give it the name of the client you are attempting to contact and the number of retries it gets.  I usually only give it 1.  It will return TRUE if contact was made.  You then make a decision of what to do at that point. I allow the script to proceed if the response is TRUE or I send the client name to an error log if it is FALSE. Function Test-ClientConnectivity { Param (     $ComputerName ,     $Loop = 4 )     # Set the control value to zero.     $Count = 0     Do {         $Count ++ ...