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
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 you? Convert-* don't work for you?
I'm
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
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 oozerd...@gmail.com wrote:
I'm confused about something. I am writing a Powershell script, using
the Quest AD
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
On Fri, Oct 5, 2012 at 12:15 PM, Steven Peck sep...@gmail.com 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
On Fri, Oct 5, 2012 at 2:14 PM, Michael Leone oozerd...@gmail.com wrote:
On Fri, Oct 5, 2012 at 12:15 PM, Steven Peck sep...@gmail.com 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
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
With Quest
get-qadmemberof USERNAME | Select name, notes
On Wed, Sep 26, 2012 at 10:44 AM, Michael Leone oozerd...@gmail.com 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
On Wed, Sep 26, 2012 at 11:15 AM, KenM kenmli...@gmail.com 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,
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
: 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-Process and Wait-Process.
The way you are using Verbose isn't the way it's MEANT to be used (although
what you
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 for the Some-Cmdlet example. I did try
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
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
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)
{
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
System Admin Issues
Subject: Re: PowerShell question
On Thu, Jan 19, 2012 at 2:26 PM, Christopher Bodnar
christopher_bod...@glic.com 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
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
www.guardianlife.com
From: Michael B. Smith mich...@smithcons.com
To: NT System Admin Issues ntsysadmin@lyris.sunbelt-software.com
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
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 question
On Thu, Jan 19, 2012 at 2:26 PM, Christopher Bodnar
christopher_bod...@glic.com 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
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 jhea...@dfg.ca.gov 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
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 put
that is awesome. Thanks Michael.
Michael B. Smith mich...@smithcons.com 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 =
I'd try something like this:
$sfDesktop = $env:USERPROFILE + \desktop
On Tue, Sep 7, 2010 at 3:36 PM, Joseph L. Casale
jcas...@activenetwerx.com wrote:
Hey Guys,
What’s the most simple and elegant way to trap for the following variable
assignment:
Eg. $sfDesktop =
-
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. Casale
jcas
[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. Casale
jcas...@activenetwerx.com wrote:
Hey Guys
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
to send something wrong
: 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,
Michael B. Smith
Consultant and Exchange MVP
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 3:50 PM, Joseph L. Casale
jcas
-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 happens to that var if the expression bails
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
Thanks Michael. That helped out.
From: Michael B. Smith mich...@smithcons.com
To: NT System Admin Issues ntsysadmin@lyris.sunbelt-software.com
Sent: Mon, May 10, 2010 8:17:21 AM
Subject: RE: Powershell Question
I can’t think of a way to EASILY do
,
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 drives
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, 2010
: 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://TheEssentialExchange.com
From: Joseph L. Casale [mailto:jcas...@activenetwerx.com]
Sent: Friday
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 sure what you are going for
there. Look
: 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 not exactly sure what you are going
for there. Look at “-match”, “findstr”, and “select”.
Regards
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 sure what you are going
for there. Look
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, I
: 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
Neat function in previous email, but I am still not seeing
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 {
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
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 amended
...@activenetwerx.com]
Sent: Thursday, January 14, 2010 4:21 PM
To: NT System Admin Issues
Subject: RE: Powershell Question
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
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 large:)
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:
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
49 matches
Mail list logo