Always A-HEAD, By being ahead you are always master of time

Hits

BOOKS

Labels

Showing posts with label Daily Feeds. Show all posts
Showing posts with label Daily Feeds. Show all posts

Saturday, December 30, 2006

Review Year 2006

Review Year 2006

Year 2006, has been far far different than I can put in words. I certainly have experienced it in much different manner than I can imagine. January 2006 I have been to London Via Texaco. It was certainly great opportunity, to understand culture of UK. I liked the fact, people respect each other so much. I have certainly gone down and shared that experience with my friend. Lot of them really liked it. More I say of UK it will be less. But difficult circumstances lead me to leave Texaco, and I joined Sussee,Singapore. Culture of Singapore is so much different than UK. Two totally different countries. These experience goes far beyond in understanding not only culture but also working style,Architechure of city, Construction, Innovation and above all collating all this information, to do similar things in India at whatever level you can.I'm thankful to GOD and all other people who have helped me out time and when I needed them, to reach such places.

On career front, I've learnt VB Script, the fact that I felt need within myself to learn, has paid me a lot. Understanding of VB Script has not only increased my domain knowledge but also gave me edge over all other Admins. It was like one day I went to Shop and got the Book for 350 Rs (I'm surprised because I thought it was costly), Started learning from the Book daily. And what ...I made a daily schedule and started moving towards achieving the goal of finishing it in 3 months Flat. I did it. And during this journey I experienced how powerful,confident you feel when you are about to reach towards your goal. Joyful and pleasant to catch in lucid words. Multiple goal has potential to give this Kind of Happiness.

All those planning,daily schedules got inspired by Robin Sharma's book Monk who .....Great Book. As we all know if you understanding (learn)something and you don't implement it, then you have not understood. Based on this experience I've decided to come up on number of books I should be reading in year 2007. I feel proud to apply the same VB Script knowledge to make Admin life easier in previous and current Organizations. When power shell got released, it was like dream came true, Because my knowledge of VB Script has cultivated my Mind, which obviously saw advantage of PowerShell. As result I have come up with Idea of Blog. Techstarts has great ideas I had: To utilize power of shell.

Financially year 2006 more or less can compete with BSE Index growth,India. Next year's goal is to leverage on it.

Purchases: Laptop was major and most beneficial.

Trips: Ooty,Kodai Kanal,Mysore

Books Read: Cracking the Code of Millionaire;Monk who sold his Ferrari;Timeless Wisdom;The Man eater of Malgudi;The One Minute Manager;Adventures_of_Sherlock_Holmes.

Relations:This is the front, I have continued to be at lost, Because every time I change my serving point, I lost all relations which has been built in that organization. This is deeply felt by me.Every time I think of it, Blame game starts in my Mind.



I wanted to keep review as small as possible, since I don't think everyone would love to read this. I'm currently reading 8th Habit of highly effective people, inspired by one of the chapters I decided to share few things with you.Since we all know "Knowledge is a power which continues to grow unless you share it." These events were certainly not planned but had I planned I can't say anymore how much effectively year 2006 would've been utilized.

But I certainly take this as starting point and this is the place I always consider as base point. From where I would continue to accelerate in forward direction. I would suggest you all to start something like this, so your planning for entire year would start for 2007.

For example:

  1. How many books you are going to read this year
  2. How many days you are planning vacation this year
  3. How much you plan to save this year
  4. Where you want to be at the end of the year

Below mentioned article inspired me to review 2006 in my life...how about you?.........

Please feel free to comment. I would certainly look forward at least ONE.

Happy New Year 2007


So, this holiday season, I respectfully suggest that you take the time to review 2006. Find a sacred space, grab your journal and write down your answers to the following questions. First, write the story of the year. Describe how 2006 went for you in as much detail as possible. Open your journal and describe the year that just happened. What were your successes? Your disappointments? What experiences were breathtakingly great? Try to recall each month or season and describe all aspects of your life. Your career, your finances, your relationships, your health, your contribution. Yes, I know that this will take some time. However, leadership is about doing the right things not the easy things.

Second, look at your goal sheets, schedule and journal from the year. How did you do on your goals? Give yourself a mark for each of your goals. If you committed to running a faster 10k and you did then give yourself a ten out of ten. If you aimed to read 50 books and only read 40 then give yourself and 8 out of 10. After reviewing your performance (big idea: all great companies and leaders look at their past performance) look for patterns. Did you excel and business but let your health slide? Did you let disappointments get in the way? Did you make the necessary mid-course corrections when circumstances changed? Reflect on your decisions. How did you perform as a decision maker? Did later events confirm your assumptions? Did you act too quickly or not quickly enough?

- Robin Sharma

Tuesday, December 19, 2006

Power Shell Folder Size

Yesterday I was going through the Virtual Labs for powershell, and found few more powers of shell. I will posting that in different post soon, I just need to format it. Live writer from MS makes life easy in formatting blogs. Here we go. I wished to find out folder size, similiar like treesize (But not tree size)

$TotalFoldSZ=0 #total folder size
$foltree=get-childitem "C:\Program Files\iTunes" #Which fold size you wish to check out, this can be easily turn into user's by using read-host

foreach ($folt in $foltree) {

if($folt.mode -match "d") { #I used mode attribute to get only directories, so what about files in the parent directory...hmm coming to in...:-)
$fsz=((get-childItem $folt.fullname -recurse Measure-object length -sum).sum)/1MB #Got the size in MB
FSize="{0:N2}" -f $fsz #Formatted to two decimals
write-host $folt.name $fsize MB # wrote to screen FolderName,FolderSize
$TotalFSZ=$TotalFSZ+$fsize #To get the total folder size
}
}
$filesize=(($foltree measure-object length -sum).sum)/1MB #This is where I check if there are files present in the parent folder. If there are #only files then I will get folder size zero, not to miss that out, I've to include it.
$fsizeMB="{0:N2}" -f $filesize #Formatted it get in MB
Write-host Total Size of Folder is ($TotalFSZ+$fsizeMB) MB #here finally I add each folder size and files inside parent folder.

Most important thing in this script is the usage of ((get-childItem $folt.fullname -recurse Measure-object length -sum).sum)/1MB . It is just makes life easy, you get powershell to add the file size and report it.

Try this PS E:\> Get-ChildItem E:\PowerShell measure-object length -Average -Sum -Maximum -Minimum and you will be pleased to see ..yeah it gives number of files in the folder,Average size of the file and maxmimum file size and Minimum file size. Just a thing to note, you can manipulate only file items, I've to checkout if there is something which can do for folders as well.Next thing I would like someone to helpout with the sorting stuff.


Technorati: ,

Powershell to view EventLogs

I was actually expecting to see some noted difference in event viewer in Vista. If you are core System Admin your job is mostly revolved around finding out in digging logs and then relate it to some meaning full Unexpected Shutdown root cause analysis. And everytime we open event logs we normally tend to open error or warning logs around 6008, unexpected reboot. And then starts the double click attack on every event log in around...to delve in message details. I wonder if there is some better solutions planned in future OS's...just for time being I have got a work around with PowerShell, this is again one Length one liner....

Get-EventLog -LogName application where{$_.Entrytype -eq "error"} convertto-html -property timegenerated,Index,Source,Message -title "ErrorLogs" -body "Errors on Server" > log.htm;invoke-item log.htm

Lets get into details, in fact there is not much technical into, it is straight forward.

Get-Eventlog -logname Application -------with this line we are in Application log. (Just imagine how many lines you will require to get into appln log via VBSCript)

We piped it to get only error with $_.Entrytype...Hmmm I was searching for long where is eventtype embedded..in the help file.

for example: get-eventlog -logname application get-member..

finally I got it. I would like this help to be more descriptive, it says everything in greek to non-programmer like me.

With above line we got all errors. Here you again have choice how many error/Warning/Information you wish to have. Just modify first line as "Get-EventLog -LogName application -newest 10"

Once I have all errors, I asked Powershell to converto-html and with properties as Header I selected TimeGenerated,Message,Source..you select as per your requirement.

Now last step here is to re-direct the output to htm file and then invoke the same with Invoke-item.



Friday, December 15, 2006

One Liner New ERA

I guess with powershell new era has started, that is all about one liners. Code which takes about min 10 lines in VBScript is reducing to one line and with much better output. below is one of the example which finds out local drive on the computer and list there properties

Power shell code

$process=get-wmiobject -class win32_logicaldisk where{$_.drivetype -eq 3}

foreach($proc in $process) {

write-host VolumeName :-> $proc.VolumeName

write-host Filesystem :-> $proc.filesystem

write-host Filesize :-> $proc.size

write-host Freespace :-> $proc.FreeSpace

Write-host ========================

}

Output is below

VolumeName :->
Filesystem :-> NTFS
Filesize :-> 20974428160
Freespace :-> 2152263680
========================
VolumeName :-> Windows2004
Filesystem :-> NTFS
Filesize :-> 39028953088
Freespace :-> 11977916416
========================

Get-WmiObject -Class win32_logicaldisk | where{$_.drivetype -eq 3} | sort size (Just one line...........)

OutPut is Below

DeviceID : C:
DriveType : 3
ProviderName :
FreeSpace : 2152235008
Size : 20974428160
VolumeName :

DeviceID : E:
DriveType : 3
ProviderName :
FreeSpace : 11977916416
Size : 39028953088
VolumeName : Windows2004

But power of powershell is explored in different ways I know. I would soon get use to it and come with more examples like this.

Technorati tags:

Thursday, December 14, 2006

PowerShell -Great Computer Shell and Not just another



I know there are lots of better and much better articles on Power shell, But still powers of powershell are so much immense that I can't resist tell you what I learnt so far.

As per Jeffery there are 5 things you must know before you start powershell

So let's start
Get-Help
Get-Command
Get-alias
Get-PSdrives
Get-Member


Any Get-Help (command name) has following option
1) Syntax reference
2) -Detail gives detail information
3) –full everything plus more examples

For example:

Get-help wmi-object
get-help WmiObject –full
get-help WmiObject -detail

Get-Help wmi -Examples out-file c:\wmiexa
(Above command get the results and push over bridge(Pipe) to out-file wmiexa.txt )

Get-command: this command not only show what command are available in PS but also can help in search any file on your C-drive. Just try get-command *.dll and see for yourself.

Get-PSDrives: one of the most daring innovations of PS. You can actually browse into registry using this command and check out what is stored over there and that too much much better format.

First run get-psdrives and then simple CD into HKLM to get into registry. If you can get into registry sure there is specific way to modify it as well.

Now Get-member, I found this command very handy. You know to get details of methods of any class, I use to run scriptomatic if it was WMI Class or move to MSDN, where every min something keep changing, so after min change link goes dead. Don’t trust me, search for Media Player SDK and get proved. But now Jeffery and his team makes this very easy. I don’t mumble out any words check the screen shot below.

One of the major source of inspiration for me to go for Power Shell , is the Dotnet class can also be invoked from here. This was lacking in VBScript and as result I was actually going to learn VB.net. Thank GOD..And Many thanks to Jeffery Hicks and his book on Powershell, Please download Powershell sample chapter to learn.

I wanna put screen but it is not getting display properly...I will put in few days on my google pages.



Monday, December 11, 2006

Daily Feeds


I found out a very good Webcast on PowerShell, Worth watching wish I get it some way downloaded for future use. It is given by powerShell Architect. And most important thing about this webcast is that it has 50 min of demo and it is very good quality video.


There is no point in giving link so take down the title of the Webcast.


TechNet Webcast: Windows PowerShell: Next Generation Command Line Scripting (Level 300) (ID:1032306183)