arg
to the invoke cmd and convert to an xml object
to get the nice parsing/xpath ability...
Thanks!
jlc
From: Michael B. Smith
Sent: Thursday, February 14, 2013 5:21 PM
To: NT System Admin Issues
Subject: RE: Powershell question
ToString() doesn't work for
ToString() doesn't work for you? Convert-* don't work for you?
I'm a little confused as to what you want to do...
From: Joseph L. Casale [mailto:jcas...@activenetwerx.com]
Sent: Thursday, February 14, 2013 7:14 PM
To: NT System Admin Issues
Subject: Powershell question
Hey guys,
I have a System.
On Fri, Oct 5, 2012 at 2:14 PM, Michael Leone wrote:
> On Fri, Oct 5, 2012 at 12:15 PM, Steven Peck wrote:
>> So...
>>
>> $TheUsers = Get-QADGroupMember $GroupName -type 'user'
>> At this moment you have the user objects and their properties so let's try
>
> Yes, but that's not all I want. I *do*
On Fri, Oct 5, 2012 at 12:15 PM, Steven Peck wrote:
> So...
>
> $TheUsers = Get-QADGroupMember $GroupName -type 'user'
> At this moment you have the user objects and their properties so let's try
Yes, but that's not all I want. I *do* want to see any groups that are
members of $GroupName, but not
So...
$TheUsers = Get-QADGroupMember $GroupName -type 'user'
At this moment you have the user objects and their properties so let's try
$TheUsers | Get-Member
Looking at the Properties field there is a "AccountIsDisabled" property..
yay. Lot's of other properties as well which is nice since you
I think this should work for you:
$TheUsers = Get-QADGroupMember $GroupName | where {$_.type -eq 'user'} |
Select Name | Sort Name
On Fri, Oct 5, 2012 at 11:36 AM, Michael Leone wrote:
> I'm confused about something. I am writing a Powershell script, using
> the Quest AD CMDLETs. I have a list o
This will get only user type objects
Get-QADGroupMember $GroupName -type 'user'
This will get only user type objects AND users from any nested groups.
Get-QADGroupMember $GroupName -type 'user' -indirect
So if the rest of your script currently works that should be the only
change you have to make
On Wed, Sep 26, 2012 at 11:15 AM, KenM wrote:
> With Quest
>
> get-qadmemberof USERNAME | Select name, notes
Well, THAT was stunningly easy! LOL Thanks. That will make the report
a whole lot easier, I think ...
I will have to read up on these Quest addins
~ Finally, powerful endpoint secu
With Quest
get-qadmemberof USERNAME | Select name, notes
On Wed, Sep 26, 2012 at 10:44 AM, Michael Leone wrote:
> I have this request to list all the groups a specific set of users
> belong to. Since we use groups to control ACLs, this can (effectively)
> be a listing of all the shared folders
With the Quest CMDLets this works:
get-qaduser jdoe -properties memberof|select -expandProperty
memberof|get-qadgroup|select name,notes
Christopher Bodnar
Enterprise Architect I, Corporate Office of Technology:Enterprise
Architecture and Engineering Services
Tel 610-807-6459
3900 Burgess P
>I didn't use Wait-Process below because I want the exit value.
Did someone say exit code?
$Args = New-Object System.Collections.ArrayList
[void]$Args.Add("--Bad-Arg")
$Process = New-Object System.Diagnostics.Process
$Process.StartInfo.UseShellExecute = $false
$Process.StartInfo.RedirectStand
12 7:06 PM
To: NT System Admin Issues
Subject: RE: Powershell question
Actually, you are right about the -verbose, I forgot about that and simply
opened up the first script.
CmdletBinding enables all cmdlets to produce the output if they provide...
I am not following you on the & operator
cons.com]
Sent: Wednesday, May 30, 2012 4:41 PM
To: NT System Admin Issues
Subject: RE: Powershell question
You need to take a look at the & operator and the invoke-command and
invoke-expression cmdlets.
Insofar as "push the extra arg into the array list" YUCK. Check out
Start-Proc
You need to take a look at the & operator and the invoke-command and
invoke-expression cmdlets.
Insofar as "push the extra arg into the array list" YUCK. Check out
Start-Process and Wait-Process.
The way you are using Verbose isn't the way it's MEANT to be used (although
what you are doing cer
Thanks guys!
From: Brian Desmond [br...@briandesmond.com]
Sent: Tuesday, April 03, 2012 4:13 PM
To: NT System Admin Issues
Subject: RE: Powershell question
How about something like this. You can figure out what $value1 and $value2
should look like (could
How about something like this. You can figure out what $value1 and $value2
should look like (could just be your Test-Path calls or maybe the function is
registry aware...).
[bool]function XorValues($value1, $value2, [ref]$outputVal)
{
if ($value1 -xor $value2)
{
Write a function.
You can also do this with a filter, but almost no one uses filters. And it
wouldn't reduce your line count any more than a function would.
-Original Message-
From: Joseph L. Casale [mailto:jcas...@activenetwerx.com]
Sent: Tuesday, April 03, 2012 5:27 PM
To: NT System A
nuary 19, 2012 7:58 PM
To: NT System Admin Issues
Subject: Re: PowerShell question
On Thu, Jan 19, 2012 at 2:26 PM, Christopher Bodnar
wrote:
> I've got a PowerShell script that enumerates a list of groups and
> their members. Works great in the domain that I run the script from
&
On Thu, Jan 19, 2012 at 2:26 PM, Christopher Bodnar
wrote:
> I've got a PowerShell script that enumerates a list of groups and
> their members. Works great in the domain that I run the script from
> (acme.com). Trying to make the same script work against a
> trusted domain (Widgets).
> Get-QADGrou
In that case, I've got no clue. Sorry... :(
Regards,
Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com
From: Christopher Bodnar [mailto:christopher_bod...@glic.com]
Sent: Thursday, January 19, 2012 3:30 PM
To: NT System Admin Issues
Subject: RE: PowerShell que
www.guardianlife.com
From: "Michael B. Smith"
To: "NT System Admin Issues"
Date: 01/19/2012 03:07 PM
Subject: RE: PowerShell question
DFL and FFL? Is Exchange in the mix? And if so, what version (including
SP)?
Regards,
Michael B. Smith
Consultant a
DFL and FFL? Is Exchange in the mix? And if so, what version (including SP)?
Regards,
Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com
From: Christopher Bodnar [mailto:christopher_bod...@glic.com]
Sent: Thursday, January 19, 2012 2:27 PM
To: NT System Admin Issues
Sub
that is awesome. Thanks Michael.
>>> "Michael B. Smith" 1/4/2011 1:17 PM >>>
Here is your updated script:
- start -
$root=([ADSI]"").distinguishedName
$Group = [ADSI]("LDAP://CN=Domain Admins,CN=Users,"+ $root)
$members = $Group.member
foreach( $member in $members ) { $ary = $member.S
Here is your updated script:
- start -
$root=([ADSI]"").distinguishedName
$Group = [ADSI]("LDAP://CN=Domain Admins,CN=Users,"+ $root)
$members = $Group.member
foreach( $member in $members ) { $ary = $member.Split( "," ); $result =
$ary[0].Substring(3); $result; }
- end -
If you
download the Quest AD cmdlets
get-qadgroupmember GROUPNAME | Select Name | out-file c:\users.txt
On Tue, Jan 4, 2011 at 4:08 PM, Joseph Heaton wrote:
> I found this really simple powershell script that will list all members of
> a specified AD group. What I'd like to do is then pipe that to a
ttp://TheEssentialExchange.com
-Original Message-
From: Joseph L. Casale [mailto:jcas...@activenetwerx.com]
Sent: Tuesday, September 07, 2010 4:09 PM
To: NT System Admin Issues
Subject: RE: Powershell Question
Yeah,
You have to pardon my lack of ps experience:)
I really don't know what ha
o: NT System Admin Issues
Subject: Re: Powershell Question
I think you can try this:
$sfDesktop = [Environment]::GetFolderPath("Desktop")
If(!(test-path $sfDesktop)) {
write-host "Something's wrong"
}
Else {
write-host "It worked"
}
On Tue, Sep 7, 2010 at
Original Message-
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Tuesday, September 07, 2010 1:46 PM
To: NT System Admin Issues
Subject: RE: Powershell Question
Test-path is probably what you want. I'm not sure what you mean by "enumerate
correctly".
Regards,
Micha
y, September 07, 2010 2:50 PM
To: NT System Admin Issues
Subject: RE: Powershell Question
Hey Rubens,
I am not too concerned with how I get the value, but more on how to trap if it
doesn't enumerate correctly.
Once I start looping through all the special folders of interest, I don't want
;
> -Original Message-
> From: Rubens Almeida [mailto:rubensalme...@gmail.com]
> Sent: Tuesday, September 07, 2010 12:46 PM
> To: NT System Admin Issues
> Subject: Re: Powershell Question
>
> I'd try something like this:
>
> $sfDesktop = $env:USERPROFILE + &quo
al Message-
From: Rubens Almeida [mailto:rubensalme...@gmail.com]
Sent: Tuesday, September 07, 2010 12:46 PM
To: NT System Admin Issues
Subject: Re: Powershell Question
I'd try something like this:
$sfDesktop = $env:USERPROFILE + "\desktop"
On Tue, Sep 7, 2010 at 3:36 PM, Joseph L.
I'd try something like this:
$sfDesktop = $env:USERPROFILE + "\desktop"
On Tue, Sep 7, 2010 at 3:36 PM, Joseph L. Casale
wrote:
> Hey Guys,
>
> What’s the most simple and elegant way to trap for the following variable
> assignment:
>
> Eg. $sfDesktop = [Environment]::GetFolderPath("Desktop")
>
>
Thanks Michael. That helped out.
From: Michael B. Smith
To: NT System Admin Issues
Sent: Mon, May 10, 2010 8:17:21 AM
Subject: RE: Powershell Question
I can’t think of a way to EASILY do that without post-processing the input
array
I can't think of a way to EASILY do that without post-processing the input
array:
$in = gc file.txt
$ary = @()
for ($i = 0; $i -lt $in.Length; $i += 2)
{
$ary += $in[$i]
}
But that isn
.
Regards,
Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com
From: Joseph L. Casale [mailto:jcas...@activenetwerx.com]
Sent: Friday, March 12, 2010 4:48 PM
To: NT System Admin Issues
Subject: RE: Powershell Question
Hey Michael,
Here is some of the output of two snapped dri
>The Select-Object cmdlet is probably what you want. It has -First, -Last,
>-Skip, -Index, etc which you can use to step in to an array
Cool,
Is there any way to clean this up, I get an error when I consecutively pipe the
$SnapOutput_Log and $GUID_Log lines together?
$SnapOutput = start-job {
> Sent: Friday, March 12, 2010 5:21 PM
> To: NT System Admin Issues
> Subject: RE: Powershell Question
>
> >so if you search for "be35a053-2fee-4aa8-aa92-6bd1b2cf5e29"
> >you want to put $JobOutput = 787bdf7a-ccff-11dd-9866-806e6f6e6963
> >or $JobOutput = D
>so if you search for "be35a053-2fee-4aa8-aa92-6bd1b2cf5e29"
>you want to put $JobOutput = 787bdf7a-ccff-11dd-9866-806e6f6e6963
>or $JobOutput = D
Neat function in previous email, but I am still not seeing how I
do what I need.
$JobOutput will contain many blocks all of that format, as an
example
what SNAPSHOT ID to reference, and then expose if I grep this
> for the Volume name “+3 lines back”. So when I job this, and put its output
> in a $JobOutput, I want to use $JobOutput for each volume that I expose to a
> drive letter. That’s the part I am unsure how to do.
>
>
>
>
ond.com
>
>
>
> c – 312.731.3132
>
>
>
> From: Michael B. Smith [mailto:mich...@smithcons.com]
> Sent: Friday, March 12, 2010 3:42 PM
> To: NT System Admin Issues
> Subject: RE: Powershell Question
>
>
>
> I’m going to say “yes”, but I’m still
to a drive
letter. That's the part I am unsure how to do.
Thanks!
jlc
From: Michael B. Smith [mailto:mich...@smithcons.com]
Sent: Friday, March 12, 2010 2:42 PM
To: NT System Admin Issues
Subject: RE: Powershell Question
I'm going to say "yes", but I'm still not exactly
m Admin Issues
Subject: RE: Powershell Question
I'm going to say "yes", but I'm still not exactly sure what you are going for
there. Look at "-match", "findstr", and "select".
Regards,
Michael B. Smith
Consultant and Exchange MVP
http://TheEssential
I'm going to say "yes", but I'm still not exactly sure what you are going for
there. Look at "-match", "findstr", and "select".
Regards,
Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com
From: Joseph L. Casale [mailto:jcas...@activenetwerx.com]
Sent: Friday, March 12,
>This would be why I said I wasn't clear on your quoting requirements. :-)
>
>I know the whole Cygwin thing combined with PowerShell combined with cmd.exe
>can be a littlestrange.
>
>This seems to work, on my system.
The amount of beer debt I amassing in your favor is getting to be rather la
s + " " + $source + " " + $dest
cmd.exe /c $prog $param
"cmd.exe /c $prog $param"
popd
}
-Original Message-
From: Joseph L. Casale [mailto:jcas...@activenetwerx.com]
Sent: Thursday, January 14, 2010 4:21 PM
To: NT System Admin Issues
Sub
>is there a particular reason you want to use II? And I'm not completely clear
>about your quoting requirements, but I'd do something like this:
Nope, I actually don't know any better:)
>cmd.exe /c c:\Program Files\cwRsync\rsync.exe $options "$source" "$dest"
Having an issue with this, so I ame
is there a particular reason you want to use II? And I'm not completely clear
about your quoting requirements, but I'd do something like this:
$arrayPaths = "Dir/1", "Dir/2", "Dir/3" -- don't need the initializer since you
have the comma operator
$options = '--verbose --recursive --blah --chmod=
Also, while I don't use regex much, the few times I have Regex Buddy
was invaluable.
http://www.regexbuddy.com/
And Micheal beat me to the link I use whenever I need a refresher.
(ok, the link I read when I have to use regex)
Brandon is evidently going to post more on the subject so you may want
This is a good start, and provides links
http://technet.microsoft.com/en-us/magazine/2007.11.powershell.aspx
Here is a link to the definitive reference:
http://msdn.microsoft.com/en-us/library/hs600312.aspx
Regards,
Michael B. Smith, MCITP:SA,EMA/MCSE/Exchange MVP
My blog: htt
49 matches
Mail list logo