Configure Folder share and working with NTFS permissions.

I have a scenario where I have to create share with individual folders for three different groups.
· Userabelongs to Group1 supposed to access group1_share.
· Userbbelongs to Group2 supposed to access group2_share.
· Usercbelongs to Group3 supposed to access group3_share.
Test details are.
Domain name:
Share name:Testshare created inside C drive.
Folder details inside share: Group1_share, Group2_share and Group3_share
Server side steps:
1.   Open AD console in domain controller then create usera, userb and userc and make them member of user group group1, group2 and group3 respectively.
2.   Create 3 different folder inside a share in either C drive or D drive (Better user non system drive for file share) and follow default steps of share wizard. By default access based enumeration (ABE) option set automatically while creating a share.
3. Now set NTFS permissions to folder Group1_share, Group2_share and Group3_share to usera, userb and usercrespectively.
4. Right-click Group1_share>Properties>security> select Group1 group and give them modify permissions.
Follow same step while setting up NTFS permissions to other two folders as well.
Workstation side steps:
5. Logon into workstation with usera login and access a share (using direct link instead of browsing all shares) \\win2k2\testshare\group1_share\

6.Others group users cannot access group1_share why because we have not set any NTFS permissions to group2 & 3 users. Similarly group1 users cannot access other two shares.

Useful links for better understanding in setting up folder share.

Make USB/Pen drive Bootable using DISKPART.EXE


Make USB bootable using diskpart.exe
Run command prompt with elevated rights
Start>type cmd> Right-click cmd (top of menu)> Run as Administrator
Microsoft DiskPart version 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: MYPC
DISKPART> list disk
  Disk ###  Status         Size     Free     Dyn  Gpt
  ——–  ————-  ——-  ——-  —  —
  Disk 0    Online          931 GB   132 GB            —– –HDD
  Disk 1    Online         7633 MB      0 B              —– —USB Pen Drive
DISKPART> select disk 1 ——Disk 1 is an USB Pen drive of 8GB
 Disk 1 is now the selected disk.
DISKPART> Create partition primary
DISKPART> List partition
  Partition ###  Type              Size     Offset
  ————-  —————-  ——-  ——-
  Partition 1    Primary           7632 MB  1024 KB
DISKPART> select partition 1 —— Select the partition of USB Pen drive
Partition 1 is now the selected partition.
DISKPART> active—— Make the partition active
DiskPart marked the current partition as active.
DISKPART> list partition
  Partition ###  Type              Size     Offset
  ————-  —————-  ——-  ——-
* Partition 1    Primary           7632 MB  1024 KB  —— * Symbol denotes that the partition active
DISKPART> FORMAT FS=NTFS LABEL=”My USB” QUICK COMPRESS—— format pen drive and label it.
  100 percent completed
DiskPart successfully formatted the volume.
DISKPART> ASSIGN Letter=F —–Assign the drive letter to your pen drive, here drive letter is F.
DISKPART> Exit ——-Exit from Diskpart utility
Now browse OS DVD/ISO and extract files to your USB pen drive then reboot a server to install OS from pen drive.
xcopy D:\*.* F:\ /E /H /F —Copy and paste all the content of D drive (DVD/CD) to F drive (USB) at one go. 


Working with Task Scheduler

1.How best we can define a task using task scheduler in windows server.
Before getting into actual topic we must know the task types.Generally we can see two types of tasks in scheduler, one is Basic task and another one is Task.Basic task is one which we can create using scheduler wizard with minimal options where as Task is the one which have lot of options to be customized and will created in desired manner.
Also we can see the difference between task scheduler console based on OS versions.  Here we take Windows 2003 and Windows 2008 R2 as an examples.
To open a console, go to 

Control panel>Scheduled Tasks —in windows 2003
Control Panel\All Control Panel Items\Administrative Tools\Task Scheduler –in windows 2008 R2 

Windows 2003 Console view

Create Basic task:-  Follow the steps based on the schedule task wizard. Useful snap-shot.
Create Task:
Control panel>Scheduled Tasks>File>New>Scheduled Task

Properties window will be like below and have less options, tasks to be run from command/script.Time to run a task followed by the settings. Security settings to run a task in general (local/domain) user/admin or local system authentication.
When we see windows 2008 R2 console,we can have lot of options to define a schedule task and window will like below.
 I personally observed many times, defined task in task scheduler not giving the results as user/administrator expected.
Possible errors are
Improper security options. In general we have two options 
Run only when user is logged on —Tasks runs only when user session is active.
Run whether user is logged on or not—Tasks runs irrespective of user session is active/in-active. But when choose this option we have to enter user credentials info, server caching this info and will  be used when its needed. But this is not a reliable option why because according to IT security policy user passwords  will change for every 45 days. 
So, schedule tasks will be used for long run may fail to run. To avoid failures we have to use local system account for authentication purpose.Also many of script based/program based tasks can be configured using local system account.

When you are working with windows 2008/2008 R2 task scheduler, tasks can be configured based on the version. If we miss this there will be a chance failures. So we must be keen in setting up proper configuration option.

2. Sample illustration to reboot a server on schedule basis. 
So we have to create a task with the help task scheduler and reboot the server once in a week.

  • Creating a task to restart server on every Sunday at 23:35 

  • Enabling Triggers: Configure the task how often or when it can be planned to run.

  • Actions: Create batch file using command “shutdown /r /f“and save it in root of C partition.Then configure script path settings and follow the wizard.

  • Conditions:Follow the default settings if you don’t to do any customization.

  • Settings:Configure settings based on your task requirement.

  • History: This help us monitoring the schedule task how is running and moreover it will help us in troubleshooting when we have issue with particular task

Note:The above illustration is applicable to Windows Server 2008 & 2008 R2

3.Schedule task completed with error code 0X1:
Generally some task which are defined in task scheduler completed with error.It may be because of improper settings of task configuration.

Open a Task Scheduler console from Control Panel\All Control Panel Items\Administrative Tools\
Choose Create new task/create basic task and follow task wizard steps.
General settings and choose the options as per the below snap-shot.
Trigger>Choose the specific time/date when the task should be run.
Actions>This tab is heart of the task and use particular program or script to run. Better use C:\ or C:\tasks folders for script path instead of desktop and other places.
Conditions and Settings>These tabs are the options we can use to define a task more precise manner.
History>This tab gives us more info that when the task has been started, how it is running details like process, services info and when it is completed successfully.Also gives us info that the task might be completed with warnings/errors.

Reference links:
Technet link:

Extend Partition Size using DISKPART.EXE (OS Built-in tool)

Diskpart.exe is a wonderful command which will come along with any Windows OS and with the help of this command we can extend partition size to desired amount.
Here is an example to extend system partition (C drive) size to 1GB more, than the existing size.

So, please follow below command steps to extend your C drive.
Start>Run>cmd>C:\>diskpart –The below message will come.
DISKPART> list disk—It will display number of disks you have in your system.

Disk ###  Status         Size     Free     Dyn  Gpt  —I have single disk (DISK 0)
——–  ————-  ——-  ——-  —  —
Disk 0    Online          XXX GB   XXX GB
DISKPART> select disk 0 — Select the disk where C partition Resides
Disk 0 is now the selected disk.
DISKPART> list volume —-This command will help you to display number of partitions

Volume ###  Ltr  Label            Fs     Type        Size     Status     Info
———-  —  ———–  —–  ———-  ——-  ———  ——–
Volume 1     C   Windows XP   NTFS   Partition     20 GB  Healthy    System
Volume 2     D   Windows 7     NTFS   Partition     25 GB  Healthy    Boot
DISKPART> select volume 1—Select the volume which assigned to C Drive/partition
Volume 1 is the selected volume.
DISKPART> extend size=1000 disk=0—- I want to add 1GB extra space to C drive (In this case 1000 MB, you need to mention size in the form of MB)

DiskPart successfully extended the volume.
DISKPART> list volume

Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
———-  —  ———–  —–  ———-  ——-  ———  ——–
*Volume 1     C   Windows XP   NTFS   Partition    21 GB  Healthy    System—-Successfully Added 1000MB to C and now it is 21GB
  Volume 2     D   Windows 7    NTFS    Partition    25 GB  Healthy    Boot

Note: Run a command with elevated rights for better results.We have many 3rd party tools but MS never recommends to use 3rd party tool.Moreover it can be used at our own risk.