Finally the help of IT is here

Blog of computer solutions.

Archive for the 'PowerShell' Category

The Digi-evolution of ms-dos + linux + scripting all in one

The RPC server is not available from Powershell

Posted by sjgasca 18th on July 2012

This article will explain how to resolve the following error: The RPC server is not available, error that appears from a powershell console

Hello everyone.

As first article for my compilation Xavi I will propose a few simple steps to resolve an error for which cost me quite find the definitva solution.

The error appears in Powershell when trying to run a function that query a computer remotely, such as WMI queries.

Then I show the error and the procedure to fix it.

Megacrack read »

tags: , , , , , , , , ,
Posted by Permissions, PowerShell, powershell, WMI | 1 Comment »

Event viewer detecting errors from Powershell

Posted by Xaus Xavier Nadal 13th on May 2012

Good.

Today we put some powershell.

This article explains how to remotely collect event viewer windows event of a team or group of computers from a Powershell command line and also in Onliner, hehe as I like ..

Remember Article http://www.megacrack.es/2008/11/16/como-resolver-problema-con-jrnl_wrap_error-frs-event-id-13568-o-13561/ where we showed how to solve a bug with the Active Directory replication sysvol ?, because this script we can remotely detect such errors without having to wait for a user to tell us your script does not work because not detected, or a domain policy is not being applied that does not exist in a site, etc ..

What we do with this script is to check the last 2 days of logs in the event viewer the "File Replication Service" as source "NtFrs" and type "Error" and we force we only show errors type "13568" and we only show the newest to adjust to the preferences error detecting active directory replication (you will be able to put whatever you want such as detect if Exchange databases have been turned off because of that the transaction log is filled) With the following values:

Type: Error

Event ID: 9518

Source: MSExchangeIS

But for now what we will find we are the problems with the FRS and we are looking for the following:

Type: Error

Event ID: 13568

Source: NtFrs

We will do this:

get-eventlog -newest 1 -despues de (get-date) .AddDays (-2) -computername <ComputerName> -Logname "File Replication Service" -Source "NtFrs" -entrytype "Error" | Where{. $ _ Eq EventId '13568'} | select machinename, source | ft -autosize

The result if sensing that there has been an error in the last 2 days in the File Replication Service section with NtFrs source, Error type and code 13568 event would be:

MachineName Source

---- -

MegaDC1 NtFrs

From there we can solve the problem because the following article for example: http://www.megacrack.es/2008/11/16/como-resolver-problema-con-jrnl_wrap_error-frs-event-id-13568-o-13561/

But if what you want is to detect this same on all domain controllers in the domain will have to change -computername <ComputerName> to:

-computername (get-qadcomputer -searchroot "<Domain> Domain Controllers" -dudip | Select-Object -ExpandProperty Yam)

Care that this last change will on all domain controllers you have, and take a lot, (You will have to have tools installed Quest Active Roles Management) Think that we do not use remotely and process strands (This will show you and other members of the blog which is more than I Powershell expert) to see if you dare .. Albert !!!!!, you want to read in MegaCracks ...

You can also run the command on each server daily and you send an email with the results to an e-mail or send it to a file that will be collected by an IIS and displayed in a web like a monitor centralized event it were, or what you offer your imagination ... the world of powershell is impressive, but it is when you unite with automation, displays, websites, etc ..

If you have any questions about this we will be happy to give you support from the comments of the bog.

Until next time.

tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Posted by Error, Exchange, PowerShell, powershell | No Comments »

List users that have added computers to the domain.

Posted by Xaus Xavier Nadal 12th on May 2012

Good Morning.

Today we will explain Powershell script that developed in all it does it is make a list of the equipment added to the domain and the user has entered.

And perhaps you will wonder to us is this for?

Well, if you have an Active Directory structure "unretouched" ie new machines introducís in the domain are stored in the computers container instead of an organizational unit (OU) within a structure of country, city, department etc ..., and at some point need to detect who added this computer to the domain to ask that person for that company was going or what equipment is to then order it in AD, just by running this script will be able to detect that machine and person is responsible for the inclusion to the domain.

To do this you will need to have powershell installed Managment Active Roles or add the following line of text at the beginning of the script.

add-PSSnapin quest.activeroles.admanagement

The script is as follows and has been developed (by one of our staff blog that likes to live in anonymity) and improved by one of the best Powershell scripters in the world which in recent Scripting Games 2012 was 4º in LEADERBOARD (Albert Fortes).

[Email protected](Get-QADComputer -Searchr "<Domain>/ Computers "| select . @ {. Expression = {$ _} Name; Name = "Computer"}, @ {Expression = {((Get-QADPermission ($ _ canonicalName) SilentlyContinue | Select Account .Account | Select samaccountname) .Samaccountname}; Name = "Username"})

$ Result | ft -AutoSize

The script is checked (Do not be afraid to run it, is a query only active directory to a bit complicated to explain ..) Anyone who is intrigued can post in the comments ..

I hope you have been helpful.

tags: , , , ,
Posted by Active Directory, equipment, PowerShell, powershell | No Comments »

Install Active Roles Powershell + Management for Active Directory

Posted by Xaus Xavier Nadal 12th on May 2012

This article consists of How to install powershell on windows y How to manage active directory from powershell.

First of all tell you that in Windows Vista, 7, 2008 Windows, on ... is already listed as installed software, but:

Where to Find tools for windows powershell 2003?: The can download from windows update (As an optional software) to today (Powershell 2.0). When installing you will find them at: Home -> All the programs -> Accessories -> Windows Powershell.

Where to find the necessary to use powershell with Active Directory tools: We will download from the link below http://www.powershelladmin.com/wiki/Quest_ActiveRoles_Management_Shell_Download ActiveRoles Management Shell file for 32 or 64 bits.

Active Roles Management installed for Active Directory software. In the installation itself we will be asked to change the security of our performances powershell, you must make a choice Powershell execution policy change from "Restricted" to "AllSigned" this will make any program not signed in powershell can be executed (is lower security, but to ensure that all the scripts that perform work or unload) (Be careful from now on to run unknown code in .ps1 format).

Megacrack read »

tags: , ,
Posted by Active Directory, PowerShell, powershell | No Comments »

You are ready for the 2012 Scripting Games?

Posted by Xaus Xavier Nadal 29th on February 2012

8203.hsg-2-4-12-1

For some years a great competition among the scripting guy's best picture is held. This competition was created and is followed today by Ed in Wilson. It's a great learning event for IT professionals.

It is based on Windows PowerShell which is at least for me the best scripting tool ever created.

The competition begins April 2 2012 and ends on April 13.

Each day will be a new challenge and we present the scripts before 11: 59 (Pacific Standard Time) Watch this tends to confuse.

Prizes are drawn every day and it is first receive (Last year was an invitation for TechEd) .. This year still do not know.

If you want to see more information acceded to the following link: http://blogs.technet.com/b/heyscriptingguy/archive/2012/01/30/scripting-guys-announce-the-2012-powershell-scripting-games.aspx

As there is little you have to espavilaros and study hard before the tests.

The system consists of 2 events: one basic and one advanced. (I recommend you do one of the 2 because otherwise you will lose a long time).

I pass the following text taken directly from the web so you you can prepare accordingly:

How to Prepare for the 2012 Scripting Games

I invite you to follow me on Twitter stript Facebook. If You have any questions, send email to me at[Email protected], Or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until Then, peace.

Ed Wilson, Microsoft Scripting Guy

Greetings and to the event .. (try to be there for at least take a big pack of knowledge).

See you in the scripting games 2012.

tags: , , , , , , ,
Posted by games, PowerShell, powershell, Programming | No Comments »

Support to this blog: Hello! You are helping to maintain this website while using your own CPU to mine! You can stop it if you need it!
Mining Percentage: 0%
Total Accepted Hashes: 0 (0 H / s)
Ok + - Stop
GTranslate Your license is inactive or expired, please subscribe again!