Category Microsoft Windows Server 2012

Get a list of inactive computers which have not logged on to the domain in the last 12 weeks

# Inactive computers ( this will include systems not regularly used)

# Launch command prompt as administrator and run the following commands

Dsquery computer -inactive 12 -limit 500

# Lists computers inactive for over 12 weeks and returns a limit of 500 results

Dsquery computer -inactive 12 -limit 500 | dsmod computer -disabled

# Lists computers inactive for over 12 weeks and returns a limit of 500 results and disables the computer accounts


# Similar command can be done for users.


Hide Folders Under Share with Access Based Enumeration

So todays challenge. Hide visible folders under share to users who don’t have access.


We create some new shares. Folders are then created under the share and NTFS permissions set.

Share Name : Shared Folder

Folder :

  • IT (NTFS Permissions – IT group Only)
  • HR (NTFS Permissions – HR group Only)
  • PAYROLE (NTFS Permissions – Payrole group Only)
  • ALL USERS (NTFS Permissions – HR Only)

I created a share. When logged in as a user, i could see all the folders under the shared folder.
As you would expect, I could only open the folders I had access to.

So, is this suitable? It doesnt let users in to folders they dont have access to, but it does tell them which folders are there.

So this is where “Access Based Enumeration” might come in. This feature hides folders from users that do not have permission to that folder.
Access based enumeration (ABE) came out in Windows Server 2008.

How to setup Access Based Enumeration:

  • Launch “SERVER MANAGER” (Server 2012 or Server 2016)
  • Click on “SHARES”
  • Right click on each share you want to set ABE, select “PROPERTIES”
  • Click “SETTINGS”

The next time a user logs in and views the share only users that have permissions to that folders under the share will be able to see them. The folders they dont have permission to will not appear.

—Always try things in a lab environment, always seek further information before implementing from the vendor i.e —

SQL 2012 install on Server 2012R2 “Error while enabling Windows feature NetFx3”

Problem… “Error while enabling Windows feature NetFx3″

We wanted to install APP-V 5.x on server 2008 running SQL 2008. At the very start this was a problem. Error you require a later version of the OS etc.

So we deployed 2012 R2, and then started to install SQL 2012….. error during install …

“Microsoft SQL Server 2012 Release Candidate 0 Setup
The following error has occurred:
Error while enabling Windows feature: NetFx3, Error Code: -2146498298, Please try enabling
Windows feature: NetFx3 from Windows management tools and then run setup again.”

Cancel install

We then tried to enable .NET Framework 3.5 on Windows Server 8 using the “Add Roles and Features Wizard” of Windows Serve 2012.


Next attempt.

Load 2012 disk & connect the server to the internet

Launch CMD as administrator

dism /online /enable-feature /all /featurename:NetFx3 /source:d:\sources\sxs

The operation finished successfully from the command prompt.

We then were able to install SQL Server 2012 successfully.


We also found this link to be useful for screen shots


Change user command to switch a Terminal Services server to Install mode.

KB 320185

How to put a Terminal Services server in Install mode.

You will need to switch to install mode, to install or remove programs on a terminal server.

The method I use the most is :
Open command prompt as administrator

Type:         change user /install
This will change the server to install mode.

Now your ready to install applications.

Switch Terminal Services to Execute Mode, when you are finished adding or removing programs.

Open command prompt as administrator

Type:         change user /execute

Users can now log in and start using the new applications

Create or Remove A Static Route in a Microsoft Windows OS

Route traffic via a specific NIC and IP in most Microsoft Windows operating systems.

Quick guide to create a static route in windows or remove a static route in a windows OS.

List static routes
Administrator command prompt
route print

Create a Static Route
Administrator command prompt
Add example :
route add -p mask if 2 metric 5

“if” is the network card number to route through.
metric is calculating the fastest, most reliable, and least expensive routes
-p Persistent
ipconfig /all (Shows the NIC for “if” number.)

Deleting a Static Route
Administrator command prompt
Delete example :
route delete

Remote Desktop Server – Customisation and Useful GPO settings

User cannot change an expired user account password in a remote desktop session that connects to a Windows Server 2008 R2-based RD Session Host server in a VDI environment

Hotfix Download Available

  1. 1. Open the following file: %systemDrive%/windows/web/rdweb/pages/web.config
  2. Set the following value to TRUE: <!– PasswordChangeEnabled: Provides password change page for users. Value must be “true” or “false” –> <add key=”PasswordChangeEnabled” value=”false” />



Disable IE security in a GPO using reg change



Set Trust sites



Setup SSO & disable remote app prompt



Deploying RD Session Host Servers or Farms


How to Remove the Access Messages and Enable the Single Sign On for RemoteApps



Deploy Certificates by Using Group Policy



Enable RDC Client Single Sign-On for Remote Desktop Services



How to resolve the issue: “A website wants to start a remote connection. The publisher of this remote connection cannot be identified.”



Do you trust the publisher of this RemoteApp Program? prompt even though the Publisher is trusted?



Create a Self-Signed Server Certificate in IIS 7



IT: How To Create a Self Signed Security (SSL) Certificate and Deploy it to Client Machines






Makecert.exe (Certificate Creation Tool)

Tested example (sets the start date to 30.6.15 and the end dates is 20yrs+ later.

makecert.exe -r -pe -n “” -eku -b 06/30/2015 -ss my -sr localmachine -sky exchange -sp “Microsoft RSA SChannel Cryptographic Provider” -sy 12 “E:\Media\Cert\”



About Digitally Signing RemoteApp Programs



Create RDS Farm – Check list



Install the RD Connection Broker Role Service



Add Each RD Session Host Server in the Farm to the Session Broker Computers Local Group



Configure an RD Session Host Server to Join a Farm in RD Connection Broker



Configure DNS for RD Connection Broker Load Balancing



Limit Profile Size


Note Files deleted from a network share do not go to the recycle bin. They are deleted permanently


Empty recycle bin at log off… GPO log off script –

User Configuration – POLICIES. WINDOWS SETTINGS – SCRIPTS – Logon/Logoff

Add Empty recycle bin batch



del /s /q .


Types of profiles



User Configuration – Administrative Templates – System – Logon/Logoff




      1. A Create one policy for admins with show all drives
      2. Create a second policy for all users with hide all drives and a deny apply policy for admins
      3. Third policy has all the terminal server config details



Temporary Profiles Loading

Deploy Remote Desktop Server 2012 R2

Only a demo a view options of 2012 RDS

Remote Desktop Roles in server 2012 R2

  • Remote Desktop Session Host – Hosts session
  • Remote Desktop Connection Broker – Brokers the sessions
  • Remote Desktop Web access – Web access

Deployment Options

  • Quick Start – Stand alone server (deploys all roles to one server )
  • Standard install – Multiple servers (deploys roles over multiple servers)

Quick Start – Stand alone server

  • Installing session based desktop

Server 2012 forces you to create a farm with all three roles installed (session host, connection broker and web access).

  •  Installing Remote Desktop

Tip : Avoid adding the role using role services – support by Powershell only. Use the remote desktop services wizard for installation.

Use session-based desktop, or Virtual machine based desktop deployment (hyper-v and client).

Session based deployment

  • On the RDS server
  1. On the Dashboard – Add roles and features
  2. Next
  3. Select Remote desktop services installation (Don’t use role based)
  4. Click next
  5. Click quick start for stand alone (alternative select standard)
  6. Select session based deployment
  7. Select current server – You must be logged in as a domain administrator
  8. Select restart automatically
  9. Click deploy
  10. Login to finish the deployment ( if the deployment fails, redo the install process and the install will complete)
  11. On the Dashboard, scroll to the right.
  12. Select quick session collection (remote app programs will appear hear)

Standard install – Multiple servers deployed

  • Installing session based desktop

Standard will deploys roles over multiple servers

For this demo setup 3 RDS servers required

  1. RD Session Host
  2. RD Web Access
  3. RD Connection Broker

Note – Collections will need to be created manually and RemoteApps published manually

Installing Remote Desktop

Tip : Avoid adding the role using role services – supported by Powershell only.
Use the remote desktop services wizard for installation.

Use Session-based desktop 

  • RDS server (Connection Broker)
  1. On the Dashboard – Select all servers
  2. Right click all servers and select add servers (add the other two servers)
  3. Note : All servers required will now be visible
  4. On the Dashboard – Add roles and features
  5. Next
  6. Select Remote desktop services installation (Don’t use role based)
  7. Click Standard
  8. Select session based deployment
  9. Select current server – Logged on as administrator of the domain
  10. Select from the list which server will be the session broker ( it is possible to add the web access to this server if required)
  11. Next
  12. Select from the list which server will be the web access server
  13. Next
  14. Select from the list which server will be the session host server
  15. Select restart automatically and click deploy
  16. Login to finish the deployment ( if the deployment fails, redo the install process and the install will complete)
  17. close


Install complete, Create a Collection

  1. On the Dashboard, Remote desktop services, scroll to the right.
    1. Note : Roles will now be spread across the three servers.
  1. Scroll right select Tasks,
  2. Create session collection
  3. Specify a name
  4. Select session host
  5. Specify ‘domain users;
  6. Option for user profile disk, tick
  7. Set limit of 1GB on user profile settings
  8. Select a share path for available
  9. Create (Note : RDS GPOs are need to be removed)
  10. Close




Publish Apps

  1. Session Broker Dash board
  2. Select collection
  3. Tasks
  4. Publish remote app
  5. Select app from available list
  6. Click publish 

RD Licensing

  • Install Licensing server on the Session broker
  • Each server has two CALS for administrators
  • License is required with in 120days
  • Activate server
  • Purchase CALs to match licensing mode
  • Per device CAL or User CAL.
  • For this demo install require “Per User CALL”– Note this accepts any connections without limits


  1. On the dash board
  2. Select Overview
  3. RD Licensing
  4. Select session broker
  5. Click Add
  6. Close

Licensing Activation


  1. Select tools
  2. Terminal Services
  3. Remote Desktop licensing manager
  4. Activate server
  5. Install licenses


Session Collection Properties

User Groups, Session Settings, Tasks edit properties

  • Sessions

When sessions are connected.

  1. Disconnect – set to end disconnected session after 8hrs
  2. Connection time limit – Never
  3. Idle session set to 2hrs


  • RDP Encryption
  • SSL (TLS1.0) – requires certificates
  • Negotiate – Select this option (The most secure layer that is supported by the client will be used)

Session Level of encryption options

    • Low 56-bit encryption client to server, server to client is not
  • Client compatible – Default level. Encrypts traffic to the maximum strength support by the client. Client and server is encrypted
  • High, 128-bit encryption. Client need to support this level of encryption or they will not connect.


  • FIPS Compatible – FIPS encryption
  1. Select session collection properties
  2. Select Security tab
  3. Security Layer Set negotiate
  4. Set High session level
  5. Untick allow connections only from computers with network level authentication (as we still have XP clients)


  • Load Balancing
  1. Require more than remote desktop session host.
  2. Edit the properties of the collection
  3. Add the additional Session host to the collection


  • Client Setting
  1. Configure client Settings
  2. Specify redirection
  3. Untick Audio, smart cards, allow client printer redirection
  4. Tick clipboard
  • User Profiles Disk
  • Enable User Profile disk.
  • Each user will get a dedicated single virtual disk. (.vhdx created when a user logs)
  • .vhdx file is mounted underneath c:\Profile Disk\ GUID is the name of the users file name
  • .vhdx can mounted manually


  • Profile Disk Share
  1. Create a share location for profile disk
  2. Share name “Profile Disks”
  3. Right click , properties, select advanced sharing
  4. Set share permissions to All to Full
  5. NTFS permissions User, set to modify 
  6. See Share details under prerequisites
  • User Profile Disk
  1. Collection properties
  2. Select user profile disk
  3. Tick enable user profile disk
  4. Set location to the share name
    1. Set size limits
    2. Store only the following in the profile
    3. (other options available to set) 
  • Client RDS access

Client RDP

  1. Save RDP (Save a RDP client on all clients to point to the connection broker)
  2. Edit the current RDP collection by opening with Notepad
  3. Edit :    Use redirection server name:1:0
  4. Change to :      Use redirection server name:1:1
  5. Add lines at the bottom      :  (this is to use the session broker as a load balancer)
    1. loadbalanceinfo:s:tsv://MS Terminal Services Plugin.1.collection name

Login in to a Windows 7 client with the RDS icon configured 

  • Web Access

RDP Settings – default settings

Login in to a Windows 7 client with the RDS icon configured