Sunday, September 13, 2015

Powershell: Speaking with Exhange 2007 and SQL Server

Recently I completed a script which picks up message tracking logs from Exchange 2007 and dumps them into a SQL Server. We are creating Analytical reports from the SQL Server e.g. Top Senders/Receivers, monitoring tools and the number of emails sent by them etc. Normally this process of dumping message tracking logs used to take us around 30-60 manual minutes per week. Now it takes around 5 minutes. And if in the future, as planned, I am able to put the script in a task scheduler I would be able to further reduce it to 0 minutes.

Friday, January 10, 2014

Sharepoint 2010 - Recovering Deleted Pages

Murphy's law states that if 'anything can go wrong, it WILL'. And it did for me recently, while I was uploading a file to my knowledge base document library hosted in Sharepoint 2010. While providing the location of where to save the file, I just copy/pasted the URL from my browser, where I had previously opened my knowledge base document library. As soon as I clicked on 'Save'. I knew that I have done something wrong. 

Saturday, June 29, 2013

SharePoint 2010 – Workflow History


SharePoint 2010, has a powerful feature called Workflows. I am sure you have heard about it. It is a feature which depending upon your programming intellect, can be used in the out-of-the-box mode, or you can write complex codes and routines to fulfil your heart’s desire.

Receiving Blank Emails From SharePoint Workflow

 
I had designed a workflow in SharePoint 2010, which is sending us reminder emails one hour before the scheduled start time of an Operational Calendar (list of type calendar) in our SharePoint team site. The feature is working quite well, but on and off, we were receiving some emails with blank values.

Workflow Design
It is a simple workflow which starts on every new item created or any existing item modified. The workflow will start but pause till the ‘Start Time’ minus one hour. Once the specific time comes, the workflow will send an email with the details of the activity e.g. Activity Start Time and some other fields from our Operational Calendar list.

Problem
The feature is working fine but sometimes we receive an email with blank values e.g.
 
Dear Team,
Please note the below mentioned activity is scheduled to start in the following time. Kindly take appropriate steps.
Description
Start Time: 1/1/0001 12:00:00 AM
DCA #:
Agility Ticket #:
Vendor Ticket #:
Location:
Activity Status:

On completion of the activity make sure to mark the event as 'Completed'.
Thanks,




The only clue is that the email is generated from the workflow linked with the Operational Calendar. The operational calendar has many entries and since no relevant details were mentioned in the email therefore it is impossible to find out the specific entry causing the generation of this alert/email.

Problem Found
I found that some users, after creating an entry in the operational calendar and starting the workflow, were deleting the entry. However, I want to share the diagnostics which I did, so that anyone can resolve this particular or related issues.

Diagnostics Done
1. Through research it was found that SharePoint 2010 makes a hidden list for every team site called ‘Workflow History’. In this list, it keeps the details for all generated workflows with their results which are linked with the site. Therefore all workflows running on site, document library or list level, make an entry in this list whenever they are executed.
2. The workflow history can be accessed, by appending ‘lists/workflow history’ to the site URL.
3. However since the list contains the results of all workflows for all lists/document library etc, therefore I needed to find the entries for all the workflows generated for the list ‘Operational Calendar’.
4. In order to find the List ID, we open the site in SharePoint Designer. Then we go to the ‘Lists  & Libraries’ > Operational Calendar. Once there we can view the ‘List ID’ in the ‘List Information’ box. Check the below screen shot.

image

5. Then I filtered the ‘Workflow History’ list by this specific list id. There are many common ways to filter a SharePoint list, you can use anyone of them.

6. Then I searched the date/time of when the blank email was received in the ‘Date Occurred’ column of the ‘Workflow History’ list. ‘Date Occurred’ contains the date/time of when the workflow was generated and the ‘Description’ field contains the result of the generated workflow.
7. E.g. the email was received on Sat 29/06/2013 01:01 AM, so while searching the ‘Workflow History’ table, I found the below workflows which were executed on Sat 29/06/2013 01:01 AM (please note that there can be a difference of 1 minute)

clip_image006

8. Normally one email will correspond to one entry, but on Sat 29/06/2013 01:01 AM I received two blank emails. Therefore I found two entries in the ‘Workflow History’ table.
9. I searched the ‘Primary Item ID’ for the each entry in the ‘ID’ column of the ‘Operational Calendar’ and failed to find both in my list ‘Operational Calendar’. This means that the entries were deleted from the ‘Operational Calendar’.
10. I filtered the ‘WorkFlow History’ by the ‘Primary Item ID’ of the deleted item. E.g. 1097, which gave me two entries

clip_image008[4]

11. From the above screenshot it can be deduced that the entry was created on ‘5/23/2013 10:35 PM’ and paused. Sometimes later the entry was deleted (not shown here) but when the time came for the workflow to end the pause, it executed as scheduled.

Root Cause
Once an entry is created in the ‘Operational Calendar’, the workflow is initiated with the ‘Description’ as ‘Pausing Until <start time>’.
Deleting the entry from the ‘Operational Calendar’ does not mean that the initiated workflow will be stopped/removed as well. So when the specified time (start time) comes, the workflow tries to execute but finds no corresponding entry in the ‘Operational Calendar’, therefore instead of putting relevant values, it puts the blank values and sends the email.

Solution Applied
The users have to be informed that whenever they are going to delete an entry in the Operational Calendar, they have to stop/terminate the workflow before they delete the entry. It can be done through the below steps

1. Open the entry and click on workflows

clip_image011

2. Under ‘Running Workflows’ click on the single entry of the workflow which you need to terminate.
clip_image013

3. Click on ‘Terminate the Workflow now’

clip_image016

4. Press okay to confirm the delete. Immediately under the ‘WorkFlow History’ section you will find the workflow with the status as ‘Cancelled’.

5. Similarly in the ‘Workflow History’ list, you will find the corresponding ‘Description’ as ‘Workflow OC-WorkFlow was canceled by Amad Uddin Malek.’







































Tuesday, September 11, 2012

Authorities That Be


Recently during my study time, I remembered one story that happened during my MBA MIS course and I couldn’t help smiling. I thought that I should write about it and see what morals I can pick from there. So the below is a write up which I can say with my limited memory is 80% based on 100% true facts :)

Friday, February 3, 2012

SSRS-Putting Date Range in Footer Area

Add a text box, placeholder in the footer area. Double click on ''. Put the below code in the expression. 'MonthFromDate' and 'MonthToDate' are variables which are accepting values entered by the user. 

=FormatDateTime(Parameters!MonthFromDate.Value, DateFormat.longdate) " - " FormatDateTime(DateAdd("d", -1, Parameters!MonthToDate.Value), DateFormat.LongDate)

Saturday, October 8, 2011

SCSM - Opening Closed Tickets

In SCSM, once a ticket has been closed, it cannot be re-opened. And if the ticket cannot be re-opened, the information inside the ticket cannot be changed. This is a good feature, but sometimes, you might require to do a few changes in a closed ticket.The only to do this, is via power shell. 


Login to the SCSM server, and load the Windows PowerShell from the 'Administrative Tools'. On the prompt, pass the below command. 



   Get-SCSMIncident -ID | Set-SCSMIncident -Status Active

Now any desired change can be performed on the ticket and the ticket can be re-closed. 


For changing the status of a change request, use the below steps in the article. 


http://blog.scsmfaq.ch/2011/03/01/huh-change-request-status-not-updated-what-now/

Friday, September 30, 2011

SCSM - IT Operations Perspective

Microsoft's System Center Service Manager is here. Fancy names aside, it is a ticketing system which keeps a track of all the work done in IT operations. We have just launched SCSM in our production environment and right now is a good time to tell you guys as to how I, being part of IT Operations, see SCSM. 
 

Saturday, March 20, 2010

GetMailbox With OU

Haylo,

The end user's requirement was to get the mailbox size limits and current sizes of a particular geographical location.

First I ran the command to get the mailbox name, alias and size. Its easy with a get-mailbox command.

get-mailbox -organizationalunit "OU=United States,DC=example,dc=com" -resultsize unlimited select displayname, alias, prohibitsendreceivequota, database export-csv c:\data2.csv

I used the -resultsize unlimited because otherwise exchange would have only returned 1000 rows to me, and I would have thought that it was sufficient. With this parameter I am sure I get all the data.

Get-mailbox will return all the columns to me, so if you want to see the data you can get from get-mailbox, then run it without the 'select' pipe.

get-mailbox -organizationalunit "OU=United States,DC=logistics,dc=intra" -resultsize unlimited get-mailboxstatistics select Displayname, alias, TotalItemSize export-csv c:\data4.csv

Since get-mailboxstatistics doesn't support 'OU' and get-mailbox does not return 'Item Size', therefore I used something called 'piping'. Piping allows us to send the results of one command into another command, so that the results are limited. In the above command, the results of get-mailbox are sent to get-mailboxstatistics.

Unfortunately, piping only returns data from one command (at least as far as I know). Therefore we had two .csvs and the following small filtering jobs.

a. Needed to combine the data of the 2 csvs. I sorted the data by display name and combined the columns in excel.

b. Needed to change the KBs, Bytes into MBs. I could have done through a query as well, as Ghassan did, but it was complicating my query a bit, so I didn't try it. I normally don’t use commands/queries which I don't understand, therefore I just used excel formulae to convert it.

c. ProhibitSendReceiveQuota, was showing 'unlimited' in many mailboxes. This does not mean that all of these users have unlimited mailbox sizes. This only means that they are being limited at the database level. So for this I used Excel's find/replace feature to find the size of the database and replace it with the actual size limit.

The above is good for one-off cases, but if you have a frequent reporting requirement, then I would advise you to look a bit into scripting.

As always all and any suggestions are more than welcome.

Cheerz

Tuesday, May 26, 2009

Creating a Group Policy to Log Off Remote Desktop’s ‘Disconnected’ sessions


Usually huge IT infrastructures are faced with a scenario, where server administrators, usually while using Remote Desktop Snapin in MMC, do not log off their sessions. And when they close their MMC, they are disconnected and not ‘logged off’ from the servers. This causes them to occupy and keep valuable connections on the server disallowing any other users to connect to it. Also open sessions mean that applications and processes which were running when the user disconnected would continue to run indefinitely causing them to occupy valuable system resources.

The following steps would ‘log off’ all such sessions after a specific period of time.

Note: If you want to implement this policy in your organization, please make sure that you communicate this to your server administrators. Because force ‘logging off’ (even if it is a disconnected session) would stop any application and/or copy job they might have initiated and left to run. Server Administrators must be aware of this policy so that they can plan such jobs accordingly. Also it would be a good idea to put the time-out value as high as e.g. 12-24 hours, during which most operations will finish.

  1. Open Group Policy Management through gpmc.msc. Create a linked policy on either the domain level (not a good practice) or on the OU level (best practice). Make sure you make the policy on the OU where all your Servers reside.
  2. Enforce the policy. I love this option since it gives you a clear mind that this policy is being applied way down the OU chain and would always win in case of precedence and conflict wars with other policies.
  3. Go in Computer Configuration > Administrative Templates > Windows Components > Terminal Services > Sessions.
  4. Select the option ‘Set time limit for disconnected sessions’. Enable it, and enter the time limit. ‘Never’ means the session will remain open indefinitely. Usually a time limit of 12 hours and/or 24 hours should be good enough.
  5. Please note that this setting will only log off those sessions which are disconnected by the user. It will not log off any active session.

I hope my readers know the difference between Active, Idle and Disconnected sessions. Cause if you don’t and you plan to implement a group policy, then God help your organization.

Some Hurdles

If you have put this group policy on the domain or OU level and its applied on all your servers and things are going hunky dory and suddenly Aziz from development comes and says that he made an application and he has to initiate his application from the remote desktop from a freakish service account. And after starting it, he disconnects the remote desktop, and that application is supposed to run indefinitely and with the current settings you have messed it all up! As due to force log off all applications running in the session are also closed. Now either you can lecture Aziz on the best practices of code development and execution OR you can just go in the Group Policy, put this computer account and deny the execution of group policy for this computer. And as you might know, ‘Deny’ is the mother of all precedence.

Some Alternates & Notes

  1. This setting will not work on connections to Windows XP Professional.
  2. If group policies give you a chill, then you can do this setting manually on each server or maybe you just want to do it on your mission critical and resource hungry servers. Manually it can be done by changing the RDP-Tcp Properties on the server.
  3. You can also put this limit on one or more users by making changes in their properties > sessions tab.
  4. If you can do this setting on multiple places then you would be wondering the priority each setting will have over other similar settings. The following is the priority
    1. Group Policy – Computer Configuration
    2. Group Policy – User Configuration
    3. RDP-Tcp Properties
    4. User Session Properties

Restoring a system state backup (Captain’s Log)

 

The following is the restoration of a system state backup in the ‘Captain’s Log’ format. Meaning its not very refined, might have some typos, but it will have all the steps and also the decisions that I made and why.

  1. I created a group policy on the domain level, by which I ‘Removed Help menu from the Start Menu’ for all users.
  2. I ran gpupdate /force
  3. Ran ntbackup
  4. Selected SystemStateBackup, selected a ‘Normal’ copy and then provided a location on D for copying the backup file.
  5. Backup has started and its going on well. It took some time reading the data to backup and then the numbers appeared in the ‘Backup Progress’ screen. Initially it showed me an estimated time of 3 minutes
  6. It took a little over 3 minutes. I believe in production environments it will be quite higher than this.
  7. I clicked on ‘Report’ to check whether there is anything untoward. There wasn’t.
  8. I checked the size of the backup file, it is 503 MB.
  9. Transferring the file to DEN-SRV1
  10. I don’t like copying stuff to root and don’t like to bury my file under millions of folder. So I am copying in the legal folder on C Drive.
  11. Copy complete.
  12. Now assuming that my DEN-DC1 is dead. I am going to close my virtual machine and delete all changes, since I want to use this machine for future labs and want to keep the size to minimum. This can be a very tricky scenario.
  13. Before running dcpromo, note that the DEN-SRV1 is already joined to the domain being controlled by DEN-DC1. I will keep the IP and network settings as is and see what happens. As this can happen in a real scenario.
  14. Selected ‘Domain controller for a new domain’
  15. Selected ‘Domain in a new forest’
  16. Provided the full DNS name contoso.msft. This name should exactly be the same as name of my domain. I can’t create a new domain and restore the backup of the old domain to this new domain. I know this much, okay. (Angry smiley)
  17. After giving the FULL DNS name for the new domain, I pressed ‘Next’ and its still pressed after a minute. Lets see what happens. 7:25
  18. okay done. Within a minute.
  19. Now asking Domain NetBIOS name, for which I have given ‘CONTOSO’
  20. Going with default database folder and log folder.
  21. and sysvol folder.
  22. hmmmm. DNS diagnostic failed. Obviously it would fail, since DEN-DC1 was also my DNS server. Three available options and I am going with ‘Install and configure the dns server o nthis computer, and set this computer to use this dns server as it preferred dns server’
  23. Asked for ‘Restore Mode’ and ‘Confirm’ password, and I entered Pa$$w0rd. Yes I know they are the same.
  24. Now I think installing the DNS. As I can see a server icon, with a book icon in the front and a crazy pencil writing something on it.
  25. Hmmm. I got this message. Because I chose not to remove my original IP settings and/or disjoin the computer from the domain. So it has done it himself.

clip_image002

  1. Sheezers. I should have tested the backup before running the dcpromo. Maybe I wouldn’t have required to run the dcpromo. Anyways I can try it later. Bolded to remember what I have to try later.
  2. Crazy pencil has finished writing and some installation started, no no the pencil is back again now. ‘Configuring DNS service on this computer’
  3. Okay its complete now. And its asking for a restart. Shall I restart. Okay I will. What have I got to lose except time. Its all virtual machines, I can revert back to a earlier point in time.
  4. Okay the machine is restarted now.
  5. I have logged in and now I will try to restore the backup by double clicking on it. I know that it doesn’t work as I would have restart the server in safe mode and use NTDSUTIL to restore the backup, but whats the harm in trying.
  6. ntbackup has started. I am going in wizard mode.
  7. Selected restore file and settings and browsed to the file again. Double clicking the backup file just started the ntbackup

clip_image004

  1. I selected the ‘System State’ as mentioned in the pic above.
  2. Now the restore screen is saying that ‘Restore to Original Location’ and ‘Existing Files Do not replace. I will go ahead with these options although not very sure about ‘do not replace existing files’.
  3. Failure. A good one actually. Proving that I cannot restore as is and I would have to restart in ‘Directory Services Restore Mode’, which is good because previously I was thinking that I would to restart in safe mode.

clip_image006

  1. Cancelled the restore job and now putting my finger in F8 to get the type of boot I want.
  2. Gotcha.
  3. Going in ‘Directory Services Restore Mode’
  4. First I will try using the ntbackup utility for restore. If that fails then only I would delve into NTDSUTIL
  5. Okay now another misgiving gone one regarding ‘do not overwrite existing files’. As I received the following message

clip_image008

  1. Restore progress screen is achieved. Numbers coming up and restore has started. Estimated remaining time is coming as 2 minutes 7:49
  1. Sheezers. I didn’t check what existing users and group policies are there. It would have been a good idea to create a user and a group policy in the new domain controller and see what happens after the restore job. Maybe I will try it later. Next time I just have to run dcpromo, install DNS, restart and then restart again in safe mode and then I can try it again.
  1. Restore complete 7:51. Nice. Took 2 minutes. Again in production environment this might be bigger.
  1. Okay after restart, while trying to close the progress window it has asked for a restart. Good and logical. Restarting and not going to go in Safe mode.
  1. After restart it gave me the following message L

clip_image010

  1. I clicked on ‘Yes’
  2. It requires internet connectivity and I don’t have that. Lets see I think I would build another Windows 2003 server from my authorized and licensed version and then check this. Actually that might be a bit better. I think I might have those labs somewhere.
  3. Luckily I already had one lab environment which had licensed Windows 2003 DC and a member server. Tried it and it worked like a charm. The group policy and all the users, OUs etc etc were restored.

System State Backup & Restore

Note: The following scenario is to be used when your domain controller is shot and it was the one and only domain controller in your environment. If you had more than one domain controllers, then the following steps are not for you.

1. Create a backup of the system state through ntbackup
2. Store in a share location.
3. Shut down the DC.
4. Create a new windows 2003 server
5. Run dcpromo to make it a domain controller. Make the following selections
a. Select ‘Domain Controller for a new domain’
b. Select ‘Domain in a new forest’
c. The full dns name should be exactly the same as the previous domain.
6. Continue to install DNS services
7. Restart the server.
8. Restart the server in ‘Directory Services Restore Mode’
9. Run ntbackup restore
10. Select the backup file which was created in step 1
11. Once the restore is complete, restart the server.
12. And now you can see all the objects, group policies etc which were present in the old domain controller.

Sunday, May 24, 2009

Enabling Remote Desktop Through Group Policy

Recently, in an organization I know very closely, a requirement came up to allow a set of users to use 'Remote Desktop' for troubleshooting purposes. The AD administrators over there thought for a while and applied the most convienient, common but also the riskiest solution i.e. giving 'Domain Admin' access to all these users. Something ticked me that its wrong and there must be a better solution. 

While doing my MCSE, I leared about Group Policies and then stumbled upon the less riskier option of the above mentioned problem. I tried it in my lab and it worked like a charm. Although not all the following steps are necessary but they are based on best practices. 

1. Create a security group, which would contain all users for whom you want to give Remote Desktop for all your servers/computers. 

2. Put the users inside that security group. 

3. Open the Group Policy Management Console by typing the command gpmc.msc in Run. If you don't have GPMC, then download it for free from the internet and install it in your domain. Although you can work without GPMC as well, but it is basically criminal not to have GPMC if you want to work with Group Policies.

4. Create a group policy on the domain / OU level. If you are sure that all your computer are inside a single OU (usually the computers OU), then apply the policy on that OU, otherwise create the policy on the domain level. In the organization under discussion, they have servers spread all the over the OUs. 

5. Make sure that you have selected the 'Enforced' option. This option would ensure that the group policy is inherited into child OUs upto the last level, even if inheritence is closed on a child OU or a Child OU has a conflicting Policy Setting. 

6. Edit the policy and go in 'Computer Configuration > Windows Settings > Restricted Groups' and then add the group 'Remote Desktop Users'. Add the security Group you created in Step 1 as a member of this group. This would add this group in all the Built in group 'Remote Desktop Users' inside 'Local Users and Groups' of each computer. Please note that application of a group policy might take sometime. If you want to force update you can run the 'gpupdate /force' command on the Target Computer. 
 
7. Now you need to enable Remote Desktop service/option on all the target computers. Staying within the same policy, go in Computer Configuration > Administrative Templates > Windows Components > Terminal Services. Find the option 'Allow Users to connect remotely  using Terminal Services' and then Enable that option. 

After this you are good to go. As soon as the group policy is applied on the computer, it would allow all the users in the security group you created in step 1 to start 'Remote Desktopping' to the computers. I tried in my lab and it worked like a charm. 

I have written this thinking that you might have worked with AD and/or at least know what and where the group policies are. If you want further information, feel free to drop a line. 


Sunday, May 17, 2009

Eject USB

Roof Fiddler,

I've seen this happening on XP too every now and then, so there's nothing
new in this behavior on Vista. Two ways I usually troubleshoot/workaround
this issue: configuring drive for quick removal and tracking down offending
process.

1. To configure drive for quick removal, Open Device Manager; expand "Disk
drives" node; double click drive in question; on the Policies tab make sure
"Optimize for quick removal" radio-button is checked. This will slow down
file operations on the drive but will allow you to remove it at any moment
without even using (sometimes failing) "Safe Removal" function.

2. Two usual suspects that can keep your USB drive busy are System Restore
and Indexing. I'd check their settings to see if your system configured to
either create restore points for this drive or to index its contents for
instant search. Also, I'd find out exact instance of svchost that has
handles open to this drive and which services are running under this
instance. I use Sysinternals' handle.exe and built-in tasklist.exe
command-line utilities for this. First, you run

handle DRIVE:

to get PIDs of processes that have handles open on the drive. Then you can
run

tasklist /SVC /FI "PID eq PROCESS_ID"

where PROCESS_ID is the PID you've got from handle. If it's svchost that has
handles open, you'll get the list of services that run under this instance
of svchost.

To get friendly names of services, you can use sc.exe built-in utility:

sc qc SERVICE_NAME | find /i "DISPLAY_NAME"

where SERVICE_NAME is the name you've got from taskilst output.



Example:
======================8<========================
C:\>handle H:\

Handle v3.2
Copyright (C) 1997-2006 Mark Russinovich
Sysinternals - www.sysinternals.com

System pid: 4 1C8:
H:\$Extend\$RmMetadata\$TxfLog\$TxfLogContainer00...
System pid: 4 270:
H:\$Extend\$RmMetadata\$TxfLog\$TxfLog.blf
System pid: 4 27C:
H:\$Extend\$RmMetadata\$TxfLog\$TxfLogContainer00...
System pid: 4 288: H:\$Extend\$RmMetadata\$Txf
System pid: 4 368: H:\System Volume
Information\{3808876b-c176-4e48-b7...
System pid: 4 36C: H:\System Volume
Information\{477ccf48-a888-11db-b5...
svchost.exe pid: 1148 5BC: H:\$Extend\$ObjId
svchost.exe pid: 1148 5C4: H:\System Volume Information\tracking.log

C:\>tasklist /SVC /FI "PID eq 1148"

Image Name PID Services
=============== ========= =======================================
svchost.exe 1148 AudioEndpointBuilder, CscService,
EMDMgmt,
hidserv, Netman,
PcaSvc, SysMain,
TabletInputService,
TrkWks, UmRdpService,
UxSms,
WdiSystemHost, WPDBusEnum, wudfsvc

C:\>sc qc AudioEndpointBuilder | find "DISPLAY_NAME"
DISPLAY_NAME : Windows Audio Endpoint Builder

C:\>sc qc CscService | find "DISPLAY_NAME"
DISPLAY_NAME : Offline Files

C:\>sc qc EMDMgmt | find "DISPLAY_NAME"
DISPLAY_NAME : ReadyBoost

C:\bin>
======================8<========================

Hope this helps,

--
Alexander Suhovey

Sunday, March 29, 2009

Windows PE 2.0: a tiny version of Windows for system maintenance

Original Link: http://apcmag.com/windows_pe_20_a_tiny_version_of_windows_for_system_maintenance.htm

James Bannan
22 August 2006, 4:28 AM

Few people know it, but when you boot off the Vista install DVD, you're booting into a different version of Windows altogether: Windows PE 2.0. Stripped away from the Vista installer, it's a remarkably powerful, compact OS.

Few people know it, but when you boot off the Vista install DVD, you're booting into a different version of Windows altogether: Windows PE 2.0.

It's based on the Vista kernel, but it's extremely compact. It provides read/write access to NTFS filesystems, a wide range of 32- and 64-bit hardware drivers, network connectivity and the ability to run both 32- and 64-bit applications.

However, stripped away from the Vista installer, it's also a very versatile tool for administrators. It allows troubleshooting, installation and system recovery, and its small size means it can be run from CD, USB key or even via network boot.

PE has actually been around since the release of XP, but most administrators have avoided using it, instead preferring more mature third-party management and installation tools.

The newest version of Windows PE (version 2.0), is different. Along with tools which I’ve discussed previously, ImageX and System Image Manager (SIM), Windows PE 2.0 is bundled in the Windows Automated Installation Kit (WAIK), and is an integral part of both the WAIK and Vista itself.

How to get Windows PE

To use Windows PE 2.0, you need to get your hands on the Windows Automated Installation Kit (WAIK), which is a free download from Microsoft.

Finding WinPE on your machine

Once the WAIK is installed, the WinPE folder structure is available in C:\Program Files\Windows AIK\Tools. The main folders needed are the architecture folders (x86, ia64 and amd64), and the PETools and Servicing folders.

Building your own bootable WinPE 2.0 environment

The next step is to create the actual WinPE tool, based on the architecture you require. This is done using the COPYPE.CMD command, which resides in the PETools folder. Navigate there in a command window, or just launch the “Windows PE Tools Command Prompt” link from Start, Program, Microsoft Windows AIK.

winpe02_small.png

The COPYPE.CMD syntax is “COPYPE.CMD ”, so in this case I’m using “COPYPE.CMD x86 C:\Temp\x86_PE”. The destination folder gets created as part of the process, and shouldn’t already exist. Files are expanded and copied into the correct folder structure - the whole process takes no more than a minute or two.

winpe03_small.png

The resulting x86_PE folder contains the WINPE.WIM file, a MOUNT folder which you can use to mount the WIM via ImageX, an ISO folder which contains all the files needed to create a WinPE ISO image, and the BIN file needed to make the ISO bootable.

winpe04_small.png

The ISO is created using OSCDIMG - a command-line application bundled with the WinPE tools. There are quite a few command arguments available, but the most important ones are:

  • -b (specify location of boot file)
  • -n (enable long filenames)
  • -o (optimise storage by ignoring duplicate files -- this is one of the cool standard features of the WIM format).

So the syntax I’m using is “OSCDIMG -bc:\temp\x86_pe\etfsboot.com -n -o c:\temp\x86_pe\iso c:\temp\x86_pe.iso”. The process is nice and quick and the ISO is created. I used Nero to create a bootable CD and used it to fire up the Vista machine.

winpe05_small.png

Booting and using Windows PE 2.0

The Windows PE 2.0 interface looks like the Vista logon screen with a command window instead of a logon box.

Here, you can do pretty much anything. The real advantage with WinPE is that it is running a stripped-down version of the Vista kernel, so it gives you read/write access to NTFS filesystems, a wide range of 32- and 64-bit hardware drivers, network access and will launch both 32- and 64-bit applications.

winpe01_small.png

The WinPE system drive is created as X: drive, and all the other machine drives are accessible. You can map network drives, create new physical or logical drives or partition and format existing drives, and reinstall Vista - all from within the WinPE kernel space.

winpe06_small.png

Customising Windows PE 2.0

Because Windows PE 2.0 complies to all the WIM standards, you can bundle any tools and applications you like and create a customised WinPE operating environment.

You can customise deployment options, create installation menus, make use of local installation media, network distribution or Windows Deployment Services … anything really.

Windows PE 2.0 gives sysadmins a wonderful degree of flexibility. Sysadmins will be making much more use of it than they did of WinPE 1.0. If you'll need to use it for Vista deployment, you should start taking a look under the hood now.

The fact that PE uses Windows Imaging format (WIM) and XML standards means that Vista installation and deployment is the most streamlined and integrated of any Windows operating system yet.

Wednesday, January 14, 2009

Downloading From MegaUpload

1. Load the MegaUpload video in your IE. 
2. Let the video completely load
3. Go in IE > Internet Options > Browsing History > Settings > View Files. 
4. Sort the files by 'Size'. 
5. Check 'Internet Address' and 'Size' to find out which file is from megaupload. 
6. Copy the file to another location in your hard disk. 
7. Rename the file to something meaningful with extension .mp4
8. Use VLC Media Player to view the file. 

Saturday, January 10, 2009

Windows Vista Brightness Issue

Vista Brightness worked well, but whenever I closed my laptop's lid and opened it again, Windows vista started with very low brightness. The laptop's brightness keys also were not working. So I searched and came up against this article and hence got the solution.

The Solution was

1. Goto Control Panel > Power Options
2. Click on adjust Display Brightness.
3. I used the slider to select full brightness for both 'On Battery' and 'Plugged In'
4. Press 'Save Changes'
5. I switched off the power and switched it back on and hence got the full brightness I required.

For More Details and Reasons:
http://support.microsoft.com/kb/929249

Friday, January 9, 2009

Enabling Internet in a VPC Guest

Host Operating System: Windows Vista
Guest Operating System: Windows Server 2003


Shut down the Virtual Machine. 
Goto Settings > Network. And enable Shared Networking (NAT)
Start the Virtual Machine. 
Login into the Guest OS
Right Click on 'My Network Places' > Properties
Right Click on 'Local Area Connection' > Properties
Just enter the following IP in the section 
'192.168.131.254'

Courtesy: 
http://www.tipandtrick.net/2008/fix-virtual-pc-2007-shared-networking-nat-internet-not-working-in-windows-server-2003-2008-and-vista-guest-os/

Saturday, August 23, 2008

Command Line Hack for: "Terminal Server Has Exceeded the Maximum Number of Allowed Connections"


If you've worked on a network with Windows servers, you've encountered this error message at least 37,000 times:

"The terminal server has exceeded the maximum number of allowed connections. The system can not log you on. The system has reached its licensed logon limit. Please try again later."

This problem happens because Windows only allows two remote terminal services connections when you are in administrative mode, and you've either got two people already on that server, or more likely, you've got a disconnected session that still thinks it is active.

The problem with this error is that you have to actually get on the server console to fix the problem if the server isn't in a domain. (If you are in a domain, then just open Terminal Services Manager and log off or disconnect the sessions)

To use the command line hacks, you might need to run them from another server if your local operating system doesn't include the commands. You will also need to make sure that you are logged onto that server with an administrative account. The easiest way to do that is just map a drive (you don't have to use a drive letter unless you choose to)

net use /user:[username] \\servername\share

Here's a command line hack that you can use to figure out what sessions are connected to the server. Note that you could substitute the IP address for the server name.

query session /server:servername

Sample output:

 

Now we know that the session ID of the offending session is 2. We can use that in the next step, which is using the reset command to log off that user.

reset session [ID] /server:servername

Sample:

This command won't display any output, but when we run the query command again, we should see that the session has now been disconnected:

 

Note

Blogged with the Flock Browser