≡ Menu

Accessing performance counters using PowerShell

Using Get-Counter cmdlet in PowerShell V2, you can get performance counter values. For instance, if you want the current free memory statistics, use this command.

Get-Counter ‘MemoryAvailable MBytes’

If you want to query the counter continously, use below command.

Get-Counter ‘MemoryAvailable MBytes’ -Continous -SampleInterval 5

Here sampleinterval means how frequently you want to query the performance counter. You can need to parse a value in seconds for this.

Looks like cool right? You can do this from command prompt without powershell also, see my previous post.

Happy Learning..,
Sitaram Pamarthi

{ 0 comments }

Get online help about powershell commands

Today I received below nice tip from powershell.com on how to get  online help about a given cmdlet.  In below example, I am looking for online help about Get-Process cmdlet.

Get-Help Get-Process -online

Happy Learning..,
Sitaram Pamarthi

{ 1 comment }

Get User password changed time using PowerShell

It is very simple….

Get-QADUser myuser | select PasswordLastSet

If you want to know no. of days since the user changed his password, use below command

((get-date) – (Get-QADUser pamarths).PasswordLastSet).days

Happy Learning..,
Sitaram Pamarthi

{ 0 comments }

Microsoft has announced list of applications which are compatable with Windows 7. I am sure this reduces some of work for IT professionals who are working on migrating their desktops to Windows 7.  I am not saying this covers all softwares but gives information on some of(or most of) software you have in your org.

Download link is here..

Happy Learning..,
Sitaram Pamarthi

{ 0 comments }

I generally use Scriptomatic Tool for samples of WMI queries using VBscripts. It is useful and servers the purpose in many conditions. But I decided to stop using it…because, I am impressed with Microsofts new Tool “WMI Code Generator” — yay.. 🙂

It is really a rich version of Scriptomatic tool. Using WMI code generator, you can generate scripts for specific property, work with wmi events, and many more along with wmi code samples.

It helps you to,

  • Get samples codes for all WMI classes
  • Has the capability to generate code for selected properties
  • Supports and WMI methods execution
  • Supports WMI events code generation
  • Browsing WMI made easy
  • More importently, you can run this with normal user account and no installation is required. In case of scriptomatic, you should use administrator account to run it.

So, don’t miss it…

Download:

Download link is here..

Reference :

http://blogs.technet.com/askperf/archive/2010/02/02/two-minute-drill-wmi-code-creator.aspx

Happy Learning..,
Sitaram Pamarthi

{ 1 comment }

Since the time I started working with active directory, I have seen only one official interface, dsa.msc(ADUC) to work with active directory objects(users, computers, etc) — I am bored with it. With the introduction of Windows 7 and Win 2008 R2, MS has brought improvements to the way how administer your active directory with “Active Directory Administrative Center”.

Built on Windows PowerShell™ command-line interface technology, Active Directory Administrative Center provides network administrators with an enhanced Active Directory data management experience and a rich graphical user interface (GUI). Administrators can use Active Directory Administrative Center to perform common Active Directory object management tasks through both data-driven navigation and task-oriented navigation.

You can use Active Directory Administrative Center to perform the following Active Directory administrative tasks:

  • Create new user accounts or manage existing user accounts
  • Create new groups or manage existing groups
  • Create new computer accounts or manage existing computer accounts
  • Create new organizational units (OUs) and containers or manage existing OUs
  • Connect to one or several domains or domain controllers in the same instance of Active Directory Administrative Center, and view or manage the directory information for those domains or domain controllers
  • Filter Active Directory data by using query-building search

In addition, you can use the enhanced GUI to customize Active Directory Administrative Center to suite your particular directory service administering requirements. This can help improve your productivity and efficiency as you perform common Active Directory object management tasks.

So, what should be my domain to get ADAC?

If your domain level is 2008 R2, then it should work by default as it comes with ADMGS(Active Directory Management Gateway Service) which has ADWS(Active Directory Web Services) as built-in component. No worries if you have 2003 domain level also as microsft recently started to support ADWS on Windows 2003 domain controller.

Then, how can I install ADWS on my windows 2003 domain?

Active Directory powerShell blog already spoke about this. Visit http://blogs.msdn.com/adpowershell/archive/2009/06/23/use-active-directory-powershell-to-manage-windows-2003-2008-dcs.aspx for more details about this.

In brief, you should follow below steps to download ADWS source/documentation.

  1. Visit http://connect.microsoft.com and enter the invitation ID ADWS-FDBT-CVJK on the home page.
  2. Sign in using your live/hotmail ID
  3. Active Directory Management Gateway Service download details and instructions will be available to you on MS Connect site – http://connect.microsoft.com/ADWS/

Ok, I have my server side setup done. How to get the ADAC console on my machine?

You client should be running Windows 7 or Windows 2008 atleast to get this client.

  1. Install your RSAT on your machine
  2. Go to Control Panel and search for “turn windows features on or off” and select it from search results
  3. It diplays below windows and navigate to Active Directory Administrative Center and select the check box
  4. Click OK to complete the installation.

Now installation part is done, how to launch it?

Go to Start -> Run and enter “DSAC.exe” to launch the ADAC console and enjoy it’s rich features.

References :

ADAC : http://technet.microsoft.com/en-us/library/dd560651(WS.10).aspx

RSAT for Win 7: Refer to Step-3 in https://techibee.com/windows-2008/implement-group-policy-preferences-in-windows-2003-environment/161

Hope this helps you…

Happy Learning..,
Sitaram Pamarthi

{ 3 comments }

You might have seen many forums, blogs, and papers talking about the failure of Windows 7 in identifying the laptop/notebook batter life and few people also alleged that Windows 7 causing damage to their PC batteries.

Nope, it is not the case. Batteries are really in semi-degraded state in reported cases and Windows 7 is reporting it accurately“,  Says Microsoft. You can read the Complete Story from this “Windows Engineering Blog“.

Microsoft Saying that it’s a feature 🙂

Happy Learning..,
Sitaram Pamarthi

{ 0 comments }

You might get subjected error message when you run some script/vbapplication which interacts with Office products like word, excel, and Outlook through a cron/scheduled job. The reason for failure here is, problem with DCOM permissions. To resolve this issue, follow the below steps.

  1. Go to the Start-Run menu item.
  2. Type in “DCOMCNFG” and hit enter.
  3. This should load the “Component Services” MMC (you can also load from Administrative Tools – Component Services”
  4. Expand “Component Services”
  5. Expand “Computers” 
  6. Select  “My Computer”
  7. Select the “DCOM Config” item
  8. Select the “Microsoft Excel Application” item.
  9. Right click and select Properties
  10. Select the Security Tab
  11. Under “Launch and Activation Permissions” select the “Customize” option.
  12. Click the “Edit” button
  13. Click the “Add” button to add the account using which you are running the script/vb application

This should solve your problem. This solution works for all Office applications like Excel, word, and outlook as well. Only thing you need to do is, select respective office application properties instead of Excel in above procedure.

Happy Learning..,
Sitaram Pamarthi

{ 0 comments }

Customise msi installation through GPO

I read a nice article in Florian web site about Customizing msi installation through GPOs. In this article, Florian talked about how to add custom properties using ORCA(a windows SDK tool) to msi files and deploying it with GPOs. This procedure is really helpful to change some of the properties of msi files, EULA agreement status, installation directory, installation of sub components, and some of the msi checks. I thought it is helpful to my blog reads and posting it here.

http://www.frickelsoft.net/blog/?p=240

Happy Learning..,
Sitaram Pamarthi

{ 0 comments }

No more classic Start Menu in Windows 7

Looks like Microsoft has retired Classic Start Menu option in Windows 7. I haven’t seen any official confirmation about it they confirmed in a indirect way.

While working on Windows 7 machine, I looked for a way to get Classic Menu. Though I coun’t find any setting, there was a GPO policy setting with name “Force Classic Start Menu”. I thought it will enable classic menu in some way but this GPO has a description saying, “Classic start menu is removed from windows 7” and this GPO is applicable to OSes before to Win 7.

You can find similar information at http://technet.microsoft.com/en-us/library/ee617162(WS.10).aspx

However, you can get classic start menu view in windows 7 by installing a third party utility called “CSMenu“. Hope this helps.

Happy Learning..,
Sitaram Pamarthi

{ 1 comment }