Skip to main content

Posts

Showing posts with the label Windows

How to move Pagefile.sys to another drive?

Recently, I had to move Pagefile.sys from C: drive to another drive on a server to free up some space. Page file is used as a virtual memory in Windows. Generally, you can find on C:\Pagefile.sys . It is a hidden file and you won’t be able to see it until you changes settings in Windows Explorer not to hide protected operating system files. To move the Pagefile to a new drive, follow these steps. You can perform these steps on any Windows Vista, or Windows 7 on wards or Windows server 2003 on wards.   Go to Control Panel and then System and Security . Now, click on Advanced system settings on the left side column. System properties box will appear, click on Advanced tab. Under Performance , click on Settings … button Performance Options box will appear, click on Advance tab. In Virtual Memory section, click on Change… button Virtual Memory box will appear. In this box, untick Automatically manage paging file size for all drives Select the drive letter C:

Fixed: The remote session was disconnected because there are no remote desktop client access licences available for this computer. Please contact your system administrator.

The easiest way to connect to remote PC is using Remote Desktop Protocol (RDP). Most common application to make a connection to remote PC is Remote Desktop Connection in Windows environment. Sometimes you may get error while trying to make a Remote Desktop connection. Recently, I came across following error message: The remote session was disconnected because there are no remote desktop client access licences available for this computer. Please contact your system administrator. If you’re getting this error message, there are couple of ways to fix it. Option 1: Run Remote Desktop Connection ( mstsc.exe ) application as “ Run as administrator ”. Option 2: Still no luck with Option 1, try following below steps: Note : Please backup registry and make a system restore point before making changes to Registry.           Click on Start . Type Regedit and press Enter key.           In Registry Editor, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensi

PowerShell command to export a list of domain users from AD group to a CSV file

Here I go with another post on PowerShell. This time, I would like to share a PowerShell command that will help you to export list of users of particular AD (Active Directory) group to a CSV file. Run PowerShell and type following commands: # This will import ActiveDirectory module Import-Module ActiveDirectory # This command will export list of users from GroupName to a CSV file Get-ADGroupMember -Identity "GroupName" -server "TestDomain" -recursive | get-aduser -Properties mail | select name , samaccountname | export-csv -path c:\Script\report.csv -NoTypeInformation In above command, replace GroupName with the Group you want to retrieve members list. Type your domain name in place of TestDomain . Once you run above command, it will create a CSV file “ Report.CSV ” and save it in C:\Script folder. I hope you find this post very useful. Disclaimer: www.TechieTalks.co.uk does not conceal the possibility of error and shortc

PowerShell Script: Find out free disk space from multiple servers

Hi All, this is my very first post on PowerShell Script. Today, I am going to share a script that you can use to find out free disk space from multiple servers. You will have to create a Text file and a PowerShell script to accomplish this. Let’s begin by creating a Text file. I have setup a folder on my C: Drive called PS_Script (C:\ PS_Script). I created a Text file, ServerNames.txt, and saved it in C:\PS_Script folder. Use following code to create a PowerShell script and save it as DiskReport.PS1. #Get Current date $currdate = ( Get-Date ) . tostring( "dd-MM-yyyy" ) #Set path for output file $report = "C:\PS_Script\" + "DiskSpaceReport_" + " $Currdate .html" #Run command to get free disk space from multiple servers and export output to HTML file Get-WmiObject Win32_LogicalDisk -filter "DriveType=3" -computer ( Get-Content C:\PS_Script\ServerNames.txt ) | Select SystemName , DeviceID , V