Skip to main content

Posts

Showing posts with the label Windows server

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:

PowerShell Script: Update AD attributes using CSV

Hi All, in this post I am going to share information on how can you update an attribute(s) in AD for multiple objects. In this post, I am using a CSV file that contains users’ First Name, Last Name, their login name and Employee ID. I wanted to update Employee ID for all the users listed in CSV file. To achieve this, I have complied a PowerShell script that uses CSV file and update AD attributes for multiple users. CSV file: I saved CSV file in C:\ADTest.CSV . I ran following PowerShell script as admin. This script import CSV data, updates EmployeeID data for each login name (sAMAccountName) listed in CSV file. #Import Active Directory module Import-Module ActiveDirectory #Import CSV file $Obj = Import-Csv "C:\ADTest.csv" foreach ( $Usr in $Obj ) { Get-ADUser -Filter "sAMAccountName -eq ' $( $u . sAMAccountName) '" -properties * | set-aduser -replace @{employeeID = " $( $u . employeeID) " } -