Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Drumstick posted:

Is there a simple way to change user passwords? I have a csv of the usernames, and the new passwords but Im not sure how to set the new passwords. I have about 11,500 passwords that need changed...

The first hit when I typed "Powershell change windows password" into Google was this. Did you try that?

Adbot
ADBOT LOVES YOU

App13
Dec 31, 2011

Anyone have any experience with the "Powershell Cookbook" books? They are 50% off on oreilly.com right now and I'm tempted...

RICHUNCLEPENNYBAGS
Dec 21, 2010

Ithaqua posted:

The first hit when I typed "Powershell change windows password" into Google was this. Did you try that?

You don't need to gently caress around with ADSI if you have a newer Powershell version: http://ss64.com/ps/ad.html

In particular: http://ss64.com/ps/set-adaccountpassword.html

You can also use the System.DirectoryServices stuff if you want (which is the way I've done it when I didn't want to have to install the Active Directory module on every PC running my script or when I wanted to "sketch out" something that was going to be C# eventually).

RICHUNCLEPENNYBAGS fucked around with this message at 03:07 on Jul 16, 2013

Drumstick
Jun 20, 2006
Lord of cacti
Well, I went to post a big thing about how I couldnt get it to work and it turns out I just cant spell.

Thanks for the help! Its working great, I want to run it through another time or two before hitting it all.

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction
I've got a script I need assistance with. It's ping but with a timestamp and table formatting:

code:
[CmdletBinding()]
Param (
    [int32]$count = 5,
    
    [Parameter(ValueFromPipeline=$true)]
    [String[]]$computer = "google.com"
)

while ($count -gt 0) {
    $ping = Get-WmiObject Win32_PingStatus -Filter "Address = '$computer'" | Select @{Label="TimeStamp"; Expression={Get-Date}}, 
                                                                                    @{Label="Source"; Expression={ $_.__Server }},
                                                                                    @{Label="Destination"; Expression={ $_.Address }},
                                                                                    IPv4Address,
                                                                                    ResponseTime,
                                                                                    @{Label="Status"; Expression={ if ($_.StatusCode -ne 0) { "Failed" } else {"OK"}}}
    
    # Source,
    if ($count -eq 5) {
        $ping | Select TimeStamp, Destination, IPv4Address, ResponseTime, Status | ft -AutoSize
    } else {
        $ping | Select TimeStamp, Destination, IPv4Address, ResponseTime, Status | ft -AutoSize -HideTableHeaders
    }

    $count--
    Start-Sleep -Seconds 1
}
The problem is the formatting. If you run it, you can see basically works but there's way too much spacing. How can I condense the output lines to look like they're part of the same table? Alternately, is there a way to progressively add rows to an output table (I do want progressive output, instead of building up the whole thing and spitting it out all at once)

Ex results:

Factor Mystic fucked around with this message at 15:40 on Jul 24, 2013

Jethro
Jun 1, 2000

I was raised on the dairy, Bitch!
One workaround I just tested is to stick | Out-String -Stream | Select-String "." after the Format-Table. This will only print the lines that aren't blank.

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction

Jethro posted:

One workaround I just tested is to stick | Out-String -Stream | Select-String "." after the Format-Table. This will only print the lines that aren't blank.

Dynamite. Thank you.

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug
Are there any idiot's guides to powershell floating around? I'm basically bereft of scripting experience, and it's something I'm trying to pick up, but while there's a lot of resources for learning python (like codecademy, etc), I haven't found anything similarly entry-level for powershell.

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin

Falcon2001 posted:

Are there any idiot's guides to powershell floating around? I'm basically bereft of scripting experience, and it's something I'm trying to pick up, but while there's a lot of resources for learning python (like codecademy, etc), I haven't found anything similarly entry-level for powershell.

Learn Powershell 3 in a Month of Lunches.

Also, every command is well documented. Just type Get-Help and then the command. You can add -full and you'll get examples too.

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug

Dr. Arbitrary posted:

Learn Powershell 3 in a Month of Lunches.

Also, every command is well documented. Just type Get-Help and then the command. You can add -full and you'll get examples too.

Thanks! The problem is that I don't have a good handle on scripting at all beyond very simple things, so the documentation on commands will be really good...once I know what I even want to be doing. It's somewhat embarassing that I don't know this stuff, but nothing like trying to get into it, I suppose.

RICHUNCLEPENNYBAGS
Dec 21, 2010

Factor Mystic posted:


The problem is the formatting. If you run it, you can see basically works but there's way too much spacing. How can I condense the output lines to look like they're part of the same table? Alternately, is there a way to progressively add rows to an output table (I do want progressive output, instead of building up the whole thing and spitting it out all at once)

Ex results:


I don't think it answers your need for a timestamp, but I just want to point out that the Test-Connection commandlet exists and gives tabular output by default: http://technet.microsoft.com/en-us/library/hh849808.aspx

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin

Falcon2001 posted:

Thanks! The problem is that I don't have a good handle on scripting at all beyond very simple things, so the documentation on commands will be really good...once I know what I even want to be doing. It's somewhat embarassing that I don't know this stuff, but nothing like trying to get into it, I suppose.

That whole book barely even touches on scripting, it's all about using it as a shell just like a badass version of DOS.

I have a lot of luck just googling things like "powershell map network drive". Just get help on each command and you'll be set.

The coolest thing you need to know is about the pipe. |
It takes the output of one command and pipes it to the input of the next. Most of the time it just works right.

Try using Dos commands you already know like ipconfig or arp and then piping them to a utility command like Out-File or Out-Gridview. This instantly gives you some new power.

Eventually you'll want to get away from Dos because those commands aren't compatible in a lot of ways. That's when you'll start researching WMI.

I'm literally only a month or two more experienced than you on powershell, if you have any IT background you'll be leaving me in the dust in no time.

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug
So yeah, that book's pretty awesome. The biggest problem I have right now is that I just don't have much to do with it since I don't actively administrate any servers. :\ Weird infrastructure. But the book itself is rad.

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin
I'm actually having a lot of fun learning how to do stuff without having to use menus. If I want to turn off offline files I don't open the sync center. I do it through WMI. It makes me feel POWERFUL.

RICHUNCLEPENNYBAGS
Dec 21, 2010
I had the impression (mostly from reading a significant portion of it) that Windows PowerShell in Action was the one to beat.

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction

RICHUNCLEPENNYBAGS posted:

I don't think it answers your need for a timestamp, but I just want to point out that the Test-Connection commandlet exists and gives tabular output by default: http://technet.microsoft.com/en-us/library/hh849808.aspx

Thanks for the tip, but as you said there's no timestamp and I also couldn't figure out how to get it to ping forever (though, to be fair neither did the script I posted).

Mario
Oct 29, 2006
It's-a-me!

Factor Mystic posted:

Thanks for the tip, but as you said there's no timestamp and I also couldn't figure out how to get it to ping forever (though, to be fair neither did the script I posted).
I took a stab at this starting with your code and got something going. Basically, keep sending the output down the pipeline as you go, and have a single Format-Table to read in the pipeline. Also, -AutoSize seems to gather all the input first in order to know how to size the table, so that's no good.
PowerShell code:
[CmdletBinding()]
Param (
    [int32]$count = 5,
    
    [Parameter(ValueFromPipeline=$true)]
    [String[]]$computer = "google.com"
)

function Run-Ping {
    while ($count -gt 0) {
        $ping = Get-WmiObject Win32_PingStatus -Filter "Address = '$computer'" | Select @{Label="TimeStamp"; Expression={Get-Date}}, 
                                                   @{Label="Source"; Expression={ $_.__Server }},
                                                   @{Label="Destination"; Expression={ $_.Address }},
                                                   IPv4Address,
                                                   ResponseTime,
                                                   @{Label="Status"; Expression={ if ($_.StatusCode -ne 0) { "Failed" } else {"OK"}}}
        
        $ping | Select TimeStamp, Destination, IPv4Address, ResponseTime, Status

        $count--
        Start-Sleep -Seconds 1
    }
}

Run-Ping | Format-Table
This gives nice table which updates throughout the process.
pre:
TimeStamp               Destination             IPV4Address                        ResponseTime Status
---------               -----------             -----------                        ------------ ------
8/8/2013 20:04:01       google.com              74.125.142.113                               21 OK
8/8/2013 20:04:02       google.com              74.125.142.113                               19 OK
8/8/2013 20:04:03       google.com              74.125.142.113                               21 OK
8/8/2013 20:04:04       google.com              74.125.142.113                               20 OK
8/8/2013 20:04:05       google.com              74.125.142.113                               21 OK
Or instead of piping to Format-Table, pipe it to Out-Gridview for a lightweight GUI with sort/filter, that also updates as it runs.

e: tables

Mario fucked around with this message at 03:08 on Aug 9, 2013

omeg
Sep 3, 2012

OK, I feel stupid. How do you properly move contents of one directory to another? It seems like an extremely simple task but if they both contain same-named directories it turns ugly. Let's have directory structure like:
code:
a\
 aa\
  a1
 a2

b\
 aa\
  b1
 bb\
  b2
 b3
I want to move contents of b\ into a\. So aa\ directories should be merged in the end. I've tried:
code:
Move-Item -path b\* -destination a
Result:
Move-Item : Cannot create a file when that file already exists.

b\ still contains aa\, it's not copied/merged into a\.

Tried
code:
Get-ChildItem -Path b\* -Recurse | Move-Item -Destination a
But it returns the same error and copies b1 to a\, not a\aa\. How to do this properly?

Edit: "copy-item -path b\* -destination a -recurse -force" seems to work fine, just need to delete the source after. Meh.

omeg fucked around with this message at 01:04 on Aug 21, 2013

AreWeDrunkYet
Jul 8, 2006

Is there a way to use invoke-command as a sort of fire and forget mechanism instead of waiting for output. I want to kick off a script on a number of computers that I know will hang then error out on a handful of them, but don't want to deal with the waiting and error handling. The plan is to use something like

code:
invoke-command -computername <computer> -filepath <networkpath\script.ps1>
but invoke-command waits for output and passes errors.

code:
invoke-command -computername <computer> -filepath <networkpath\script.ps1> -session new-pssession
Would this work, or does creating (many) new sessions cause other concerns that I need to know about?

Eggnogium
Jun 1, 2010

Never give an inch! Hnnnghhhhhh!
-AsJob is the parameter you're looking for. Then you can save the result as a Job object you can check on later with Receive-Job.

along the way
Jan 18, 2009
Just to confirm. The Learn Powershell in 30 Lunches book is good for absolute beginners to Powershell, right.

What about someone who is new to scripting in general? I'd eventually like to automate some tasks but reading scripting tutorials for Powershell on the net makes me feel stupid for just not really getting it.

EAT THE EGGS RICOLA
May 29, 2008

along the way posted:

Just to confirm. The Learn Powershell in 30 Lunches book is good for absolute beginners to Powershell, right.

What about someone who is new to scripting in general? I'd eventually like to automate some tasks but reading scripting tutorials for Powershell on the net makes me feel stupid for just not really getting it.

Do you have any programming experience at all? If you don't, it might be worth doing a basic python/ruby tutorial.

I haven't done it, but this doesn't look terrible: http://www.learnpython.org/

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin

along the way posted:

Just to confirm. The Learn Powershell in 30 Lunches book is good for absolute beginners to Powershell, right.

What about someone who is new to scripting in general? I'd eventually like to automate some tasks but reading scripting tutorials for Powershell on the net makes me feel stupid for just not really getting it.

"Learn PowerShell Toolmaking in a Month of Lunches" is good for people who already know Powershell but want to get into scripting.

The basic book "Learn Windows PowerShell 3 in a Month of Lunches" is appropriate for people who have no experience with Powershell or scripting.

along the way
Jan 18, 2009

EAT THE EGGS RICOLA posted:

Do you have any programming experience at all? If you don't, it might be worth doing a basic python/ruby tutorial.

I haven't done it, but this doesn't look terrible: http://www.learnpython.org/

None at all. I've been a desktop/server/networking monkey for 8 years but I'm beginning to feel limited without programming/scripting experience.

Thanks, I'll take a look.

Edit: Cool, I'll tackle the first book then the second and see how it goes.

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin

along the way posted:

None at all. I've been a desktop/server/networking monkey for 8 years but I'm beginning to feel limited without programming/scripting experience.

Thanks, I'll take a look.

Edit: Cool, I'll tackle the first book then the second and see how it goes.

You'll probably be way ahead of the game. I had (and continue to have) a lot of difficulty because I don't have much understanding of things like RPC that are important when automating things that affect remote servers.

Recluse
Mar 5, 2004

Yeah, I did that.
Having troubles with a script I threw together to get/set a list of files that are not owned by BUILTIN\Administrators. It seems to work fine but takes a loooong time to run (~29 hours) on a file server hosting a lot of files. The script is running from the server host the files, and I know I have at least one issue: the Get-ChildItem seems to run relatively quickly, in about an hour or two, and then the foreach loops seems to take up the rest of the time. This presents a problem because when running this on the large shares as the difference in the results from Get-ChildItem and the actual list of files grows and when the file gets run through the foreach loop, the file may no longer exist, which ends up giving me a lot of false positives. For example, I took the results of this with the noncompliant option (just reports users that are not owned by BUILTIN\Administrators) which was an 89 MB csv file and filtered out everything that did not have a blank owner which left me with 720 results and ran that through Test-Path which left me with only 15 files that still existed. I know I could probably fix this at least by doing a test-path within the foreach loop before grabbing the properties, but I'd really like to find out where exactly the slowness is coming from, and how I can possibly resolve. Anyone have any ideas?

I've stripped it down to what I think are the only relevant portions of the script, I can attach the whole thing if needed:
code:
Function FileList ($folder)
{
	write-host Getting current list of owners for files in: $folder
	$files=Get-ChildItem $folder -recurse
		
	foreach ($file in $files)
	{
		$filetemp = New-Object psobject
		$filetemp | Add-member Noteproperty FullPath -Value $file.FullName
		$filetemp | Add-member Noteproperty DirectoryName -Value $file.DirectoryName
		$filetemp | Add-member Noteproperty FileName -Value $file.Name
		$filetemp | Add-member Noteproperty Owner -Value $file.GetAccessControl().Owner
		$fileperm += @($filetemp)
	}
	return $fileperm 
}

	elseif ($option -eq "noncompliant")
	{
		write-host Showing files where owner is not BUILTIN\Administrators.
		$noncompliant = FileList $folder | where-object {$_.Owner -ne "BUILTIN\Administrators"} 
		#Clear existing file
		if (Test-path .\$folder"_noncompliant.csv") {remove-item .\$folder"_noncompliant.csv"}
		$noncompliant | select-object FullPath,Owner | Export-CSV .\$folder"_noncompliant.csv" -NoTypeInformation
		write-host Noncompliance information written to .\$folder"_noncompliant.csv"
	}
I believe it's the foreach loop in the FileList function because when I hit a folder or file that I don't have rights to, I get an error message when trying to add the owner property and I'd see those pop-up every few hours until it finished whereas the Get-ChildItem should only run once in the beginning.

MJP
Jun 17, 2007

Are you looking at me Senpai?

Grimey Drawer
My current scripting hopeful task: I need to identify if files are still in use so we can delete them. I have the following set up which shows me the last access time:

code:
get-childitem D:\temp -rec select-object FullName, LastAccessTime > accesstime.csv
Problem is I know for a fact that these files are on our netlogon share and are logon scripts. Files that are used every day are showing that their last access time was April 2012.

It looks like in Powershell property terms, LastAccessTime is basically last time a file was modified. Is there anything for last time a file was read, or even opened/touched?

omeg
Sep 3, 2012

Last access time tracking might be disabled on NTFS volumes. I wouldn't rely on it.

Drighton
Nov 30, 2005

I'm trying to pass an object by reference to a test function. The idea is that I will call this function with an ACL and and ACE to add/remove along with other stuff. The problem is when I try to run AddAccessRule, with the error shown below. Can't find an exact example of what I'm trying to do yet, so I thought I'd check here. Also, I tend to find the answer right after posting a question, so I'm trying that theory out. :)

code:
PS C:\> $objACL = Get-ACL

PS C:\> Function Test ([ref]$oACL) {
>> $oACE = New-Object System.Security.AccessControl.FileSystemAccessRule `
("username@domain.local", "Modify", "ContainerInherit, ObjectInherit", "None", "Allow")
>> $oACL.AddAccessRule($oACE) }
>>

PS C:\> Test ([ref]$objACL)
Method invocation failed because [System.Management.Automation.PSReference] doesn't contain 
a method named 'AddAccessRule'.
At line:3 char:20
+ $oACL.AddAccessRule <<<< ($oACE) }
    + CategoryInfo          : InvalidOperation: (AddAccessRule:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

Scikar
Nov 20, 2005

5? Seriously?

Recluse posted:

I believe it's the foreach loop in the FileList function because when I hit a folder or file that I don't have rights to, I get an error message when trying to add the owner property and I'd see those pop-up every few hours until it finished whereas the Get-ChildItem should only run once in the beginning.

You might have figured this out by now but it's your use of Add-Member. There's a lot of old Powershell v1 advice floating about on the web that has been superseded by much better tools in v2 and v3, this is one. In this case there's some advice here on just how slow Add-Member is and how to make custom objects quicker.

Drighton posted:

I'm trying to pass an object by reference to a test function. The idea is that I will call this function with an ACL and and ACE to add/remove along with other stuff. The problem is when I try to run AddAccessRule, with the error shown below. Can't find an exact example of what I'm trying to do yet, so I thought I'd check here. Also, I tend to find the answer right after posting a question, so I'm trying that theory out.

I might not be understanding right (I'm not great with coding jargon) but I think Get-Acl is already one step ahead of you. The object you get as output is just a copy of the ACL, if you make any changes to it then you still need to apply them to a target with Set-Acl (or equivalent) afterwards. For example, to take ownership of a folder:

code:
function Take-Ownership($TargetFolder) {
    $CurrentUser = [Security.Principal.WindowsIdentity]::GetCurrent().Name

    $blankdirAcl = New-Object System.Security.AccessControl.DirectorySecurity
    $blankdirAcl.SetOwner([Security.Principal.NTAccount]"$CurrentUser")
    Set-Acl -Path $TargetFolder -AclObject $blankdirAcl

}
My actual code for this actually uses (Get-Item $TargetFolder).SetAccessControl($blankdirAcl) instead of Set-Acl at the end but I can't remember why, but the effect is the same.

E: Just realised that part doesn't actually use Get-Acl, whoops! I'll see if I can't find the right script I was thinking of.

Scikar fucked around with this message at 13:35 on Oct 15, 2013

H.H
Oct 24, 2006

August is the Cruelest Month
I need to use the shutdown command to restart a computer group in an AD domain. I was told this can only be achieved with a Powershell ISE script,a language in which I'm completely ignorant. The following code was suggested.


code:
# ---------- SCRIPT STARTS HERE--------------

$inputfile = Dir $args[0]
$readinputfile = get-content $inputfile
$readinputfile | ForEach-Object {

$objsystem = get-wmiobject -computername $_ -query "select * from win32_operatingsystem"
$result = $objsystem.shutdown()

if ($result.returnvalue -match "0") {
write-host "$_ - shutdown command completed" -foregroundcolor green
}
else {
write-host "$_ - unable to send shutdown command" -foregroundcolor red
}

}

# ---------- SCRIPT ENDSS HERE------------
Can anyone please explain it a bit for me, and tell me where to add the computer group in question?


Thank you very very much!

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

H.H posted:

I need to use the shutdown command to restart a computer group in an AD domain. I was told this can only be achieved with a Powershell ISE script,a language in which I'm completely ignorant. The following code was suggested.


Can anyone please explain it a bit for me, and tell me where to add the computer group in question?


Thank you very very much!

It's reading a list of computers from an input file, then iterating over every line in the file and shutting it down. You run the script with a command line argument giving the path to the file.

H.H
Oct 24, 2006

August is the Cruelest Month

Ithaqua posted:

It's reading a list of computers from an input file, then iterating over every line in the file and shutting it down. You run the script with a command line argument giving the path to the file.

So the command should be "shutdown_script comp_group.txt"?

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin

H.H posted:

I need to use the shutdown command to restart a computer group in an AD domain. I was told this can only be achieved with a Powershell ISE script,a language in which I'm completely ignorant. The following code was suggested.

There's nothing wrong with the code you were given, but here's some code that I've written that's a little more beginner friendly.

code:
Get-Content c:\Servers.txt | ForEach-Object {
Restart-Computer -ComputerName $_
}
This has a lot of weaknesses compared to the code you posted. You have to update servers.txt and you have to copy paste all this directly into powershell instead of running it as a convenient script.

The plus side is that every command in it is well documented and easy to understand, compared to goofing around with WMI.
Get-Content grabs all the servers in c:\servers.txt
the pipe: " | " sends that list to the next command "ForEach-Object"
For each of those servers it tries to execute the command "Restart-Computer" with the argument -Computername $_ ($_ is a special character that represents the current object being manipulated by ForEach-Object)

There's no error detection so you should probably go with your other script for actual work.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.
Has anyone tried out the idempotent Desired State Configuration stuff in PS 4.0 yet? If the given types do enough things, it seems like a really plausible alternative to Puppet/Chef/SCCM for Windows systems management.

H.H
Oct 24, 2006

August is the Cruelest Month

Dr. Arbitrary posted:

There's nothing wrong with the code you were given, but here's some code that I've written that's a little more beginner friendly.

code:
Get-Content c:\Servers.txt | ForEach-Object {
Restart-Computer -ComputerName $_
}
This has a lot of weaknesses compared to the code you posted. You have to update servers.txt and you have to copy paste all this directly into powershell instead of running it as a convenient script.

The plus side is that every command in it is well documented and easy to understand, compared to goofing around with WMI.
Get-Content grabs all the servers in c:\servers.txt
the pipe: " | " sends that list to the next command "ForEach-Object"
For each of those servers it tries to execute the command "Restart-Computer" with the argument -Computername $_ ($_ is a special character that represents the current object being manipulated by ForEach-Object)

There's no error detection so you should probably go with your other script for actual work.

I need to run the script as a task at midnight, so as not to restart everyone's computer in the middle of the day, so I'll try the other script. Thanks anyway!

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin

H.H posted:

I need to run the script as a task at midnight, so as not to restart everyone's computer in the middle of the day, so I'll try the other script. Thanks anyway!

That's probably a much better idea, I just wanted to show you a simpler idea so you can get an idea of how it all works together.

I'm thinking that you could get the scrip working even better by running the commands as jobs, that way it'll send everything out simultaneously instead of one at a time.

EAT THE EGGS RICOLA
May 29, 2008

You should be using some variant of Get-ADComputer -SearchBase to find the computers rather than relying on an input file, otherwise you'll have to update the file with machine names every time one gets added.

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin
I've been trying to get those AD commands to work for quite a while. I'm pretty sure that the problem is that Server 2008 SP2 isn't the same thing as Server 2008 R2.

I've got to get some upgrades in this place.

Adbot
ADBOT LOVES YOU

EAT THE EGGS RICOLA
May 29, 2008

Dr. Arbitrary posted:

I've been trying to get those AD commands to work for quite a while. I'm pretty sure that the problem is that Server 2008 SP2 isn't the same thing as Server 2008 R2.

I've got to get some upgrades in this place.

If you're on Win 7, download this then enable the Active Directory Module for Powershell Feature. It's under the Remote Server Admin Tool feature somewhere.

Then either open powershell through the admin tools menu, using the shortcut that includes active directory, or open powershell and do an Import-Module Activedirectory

Edit: Oh, you can also avoid this altogether by just remoting out: Enter-PSSession -ComputerName hostname –credential domain\AD_admin

EAT THE EGGS RICOLA fucked around with this message at 04:11 on Oct 19, 2013

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply