How to list all server Locale and Reginal setttings as CSV ?

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 9 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
ITEngineer
Posts: 216
Last visit: Thu Mar 23, 2023 5:45 pm
Has voted: 4 times

How to list all server Locale and Reginal setttings as CSV ?

Post by ITEngineer »

Hi,

Can anyone please assist me how to show the list the Locale and Reginal settings of all servers in a particular OU ?

Here's what I can start with:
PowerShell Code
Double-click the code block to select all.
$path = "C:\temp\"
$serverlist = Get-QADComputer -SearchRoot 'mydomain.com/Servers/Remote Servers' -OSName "Windows*Server*" -ShowProgress -Activity

foreach ($server in $serverlist){
	$result = Test-Connection $server -Count 1 -Quiet
	if ($result -eq "True") {
         # I need some help here.....
	}
	else {
		Add-Content "$path\Offline.txt" -Value $server
	}
}
Feel free to edit the above code if it doesn't work.

Thanks in advance.
Last edited by ITEngineer on Mon Dec 22, 2014 4:32 pm, edited 1 time in total.
/* IT Engineer */
User avatar
SAPIEN Support Forums
Posts: 945
Last visit: Thu Oct 22, 2015 1:10 pm

How to list all server Locale and Reginal setttings as CSV ?

Post by SAPIEN Support Forums »

This is an automated post. A real person will respond soon.

Thank you for posting, albertwt.

Here are some hints to help you get an accurate and complete answer to your question.

Ask in the best forum: If you asked in the wrong forum, just copy your question to the right forum.

Anticipate follow-up questions!

Did you remember to include the following?
  • 1. Product, version and build
    2. 32 or 64 bit product
    3. Operating system, e.g. Windows 7 64 bit.
    4. Attach a screenshot, if applicable
    5. Attach logs, crash reports, etc., in a ZIP file
If not, please take a moment to edit your original post or reply to this one.

*** Make sure you do not post any licensing information ***
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How to list all server Locale and Reginal setttings as C

Post by jvierra »

I just posted the answer in you other thread,
User avatar
ITEngineer
Posts: 216
Last visit: Thu Mar 23, 2023 5:45 pm
Has voted: 4 times

Re: How to list all server Locale and Reginal setttings as C

Post by ITEngineer »

jvierra wrote:I just posted the answer in you other thread,

which one man ? I cannot see it :shock:
/* IT Engineer */
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How to list all server Locale and Reginal setttings as C

Post by jvierra »

Notice this shows the user registry: http://p0w3rsh3ll.wordpress.com/2012/01 ... er-locale/
User avatar
ITEngineer
Posts: 216
Last visit: Thu Mar 23, 2023 5:45 pm
Has voted: 4 times

Re: How to list all server Locale and Reginal setttings as C

Post by ITEngineer »

jvierra wrote:Notice this shows the user registry: http://p0w3rsh3ll.wordpress.com/2012/01 ... er-locale/
yes, I can execute it from my local machine using one liner:
PowerShell Code
Double-click the code block to select all.
[System.Globalization.CultureInfo]([int]("0x" + (Get-WmiObject Win32_OperatingSystem).locale))
But how to put that intothe script so that th result is showing Servername, Culture DisplayName ?
/* IT Engineer */
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How to list all server Locale and Reginal setttings as C

Post by jvierra »

You cannot. You have to write a script to do that.
User avatar
ITEngineer
Posts: 216
Last visit: Thu Mar 23, 2023 5:45 pm
Has voted: 4 times

Re: How to list all server Locale and Reginal setttings as C

Post by ITEngineer »

jvierra wrote:You cannot. You have to write a script to do that.
yes, that's why I ask in this forum how to do that ?
/* IT Engineer */
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How to list all server Locale and Reginal setttings as C

Post by jvierra »

First learn how to do a loop and also how to display the vales returned from a WMI query.

Have you any experience at all writing scripts? I can give you some links to learning sites. It is anot really all that hard.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How to list all server Locale and Reginal setttings as C

Post by jvierra »

Here is a starter:
PowerShell Code
Double-click the code block to select all.
Get-WmiObject Win32_OperatingSystem -computer pc001 |
    select CSNAme,locale
This topic is 9 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked