Is there an equivalent in powershell for doing
"net user user1 /domain"
or really just a "net user" command.
Is there an equivalent in powershell for doing
"net user user1 /domain"
or really just a "net user" command.
malckelly wrote:What were you looking to do? You can just use "net user user1 /domain"
> Is there an equivalent in powershell for doing
>
> "net user user1 /domain"
>
> or really just a "net user" command.
from within PowerShell.
The Quest AD cmdlets also provide a lot of information, and there's a
free version:
http://www.quest.com/powershell/
Marco
--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp
PowerGadgets MVP
http://www.powergadgets.com/mvp
Blog:
http://marcoshaw.blogspot.com
You can use net.exe you can also use .NET but its a little more involved
than net.exe.
If your interested I will post some examples.
"malckelly" <malckelly@xxxxxx> wrote in message
news:90D1F7A8-98D7-4DD8-9C83-0B920CB2B684@xxxxxx
> Is there an equivalent in powershell for doing
>
> "net user user1 /domain"
>
> or really just a "net user" command.
It was really a powershell equivalent that passes out the result as an
object. At the moment I have to parse the output with regex and I just think
there must be an easier way.
"Marco Shaw [MVP]" wrote:
> malckelly wrote:>
> > Is there an equivalent in powershell for doing
> >
> > "net user user1 /domain"
> >
> > or really just a "net user" command.
> What were you looking to do? You can just use "net user user1 /domain"
> from within PowerShell.
>
> The Quest AD cmdlets also provide a lot of information, and there's a
> free version:
> http://www.quest.com/powershell/
>
> Marco
>
> --
> Microsoft MVP - Windows PowerShell
> http://www.microsoft.com/mvp
>
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
>
> Blog:
> http://marcoshaw.blogspot.com
>
Like I said to Marco it was really just some kind of command that would
return the result as an object so that it could be handled easier. At the
moment I have to user Regex to gather specific information.
"Brandon Shell [MVP]" wrote:
> You can use net.exe you can also use .NET but its a little more involved
> than net.exe.
>
> If your interested I will post some examples.
>
> "malckelly" <malckelly@xxxxxx> wrote in message
> news:90D1F7A8-98D7-4DD8-9C83-0B920CB2B684@xxxxxx>
> > Is there an equivalent in powershell for doing
> >
> > "net user user1 /domain"
> >
> > or really just a "net user" command.
malckelly wrote:Try the Quest cmdlets, otherwise Brandon has a lot of AD
> It was really a powershell equivalent that passes out the result as an
> object. At the moment I have to parse the output with regex and I just think
> there must be an easier way.
experience/knowledge.
Example (using the 2.0 CTP):
PSH> get-qaduser foo_user|get-member -force|select name
(Don't use "-force" with PSH 1.0)
Name
----
pstypenames
psadapted
psbase
psextended
psobject
PsStandardMembers
Close
Equals
GetHashCode
GetPropertyValue
GetType
get_CanonicalName
get_City
get_Company
get_ConnectionParameters
get_CreationDate
get_Department
get_Description
get_DirectoryEntry
get_DisplayName
get_DN
get_Email
get_Fax
get_FirstName
get_Guid
get_HomePhone
get_Initials
get_IsOpen
get_Item
get_LastName
get_LogonName
get_Manager
get_MemberOf
get_MobilePhone
get_ModificationDate
get_Name
get_NetworkCredential
get_Notes
get_Office
get_Pager
get_ParentContainer
get_PhoneNumber
get_PostalCode
get_PostOfficeBox
get_Sid
get_StateOrProvince
get_StreetAddress
get_Title
get_Type
get_UserPrincipalName
get_WebPage
Open
RefreshCache
ToString
accountExpires
badPasswordTime
badPwdCount
cn
co
codePage
countryCode
distinguishedName
dSCorePropagationData
employeeID
givenName
homeMDB
homeMTA
instanceType
l
lastLogoff
lastLogon
lastLogonTimestamp
legacyExchangeDN
lockoutTime
logonCount
logonHours
mailNickname
managedObjects
mDBUseDefaults
mobile
msExchALObjectVersion
msExchHomeServerName
msExchMailboxGuid
msExchMailboxSecurityDescriptor
msExchPoliciesIncluded
msExchUserAccountControl
mSMQDigests
mSMQSignCertificates
msRTCSIP-ArchivingEnabled
msRTCSIP-FederationEnabled
msRTCSIP-InternetAccessEnabled
msRTCSIP-IsMaster
msRTCSIP-PrimaryHomeServer
msRTCSIP-PrimaryUserAddress
msRTCSIP-UserEnabled
nTSecurityDescriptor
o
objectCategory
objectClass
objectGUID
objectSid
primaryGroupID
proxyAddresses
pwdLastSet
sAMAccountName
sAMAccountType
scriptPath
showInAddressBook
sn
st
telephoneNumber
textEncodedORAddress
userAccountControl
uSNChanged
uSNCreated
whenChanged
whenCreated
Item
CanonicalName
City
Company
ConnectionParameters
CreationDate
Department
Description
DirectoryEntry
DisplayName
DN
Fax
FirstName
Guid
HomePhone
Initials
IsOpen
LastName
LogonName
Manager
MemberOf
MobilePhone
ModificationDate
Name
NetworkCredential
Notes
Office
Pager
ParentContainer
PhoneNumber
PostalCode
PostOfficeBox
Sid
StateOrProvince
StreetAddress
Title
Type
UserPrincipalName
WebPage
Do you want local or domain accounts?
for local you will need to use WMI or .NET
for Domain you can use the free Quest CMDLets or .NET
Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
m> It was really a powershell equivalent that passes out the result as
m> an object. At the moment I have to parse the output with regex and I
m> just think there must be an easier way.
m>
m> "Marco Shaw [MVP]" wrote:
m>
>> malckelly wrote:
>>>> What were you looking to do? You can just use "net user user1
>>> Is there an equivalent in powershell for doing
>>>
>>> "net user user1 /domain"
>>>
>>> or really just a "net user" command.
>>>
>> /domain" from within PowerShell.
>>
>> The Quest AD cmdlets also provide a lot of information, and there's a
>> free version:
>> http://www.quest.com/powershell/
>> Marco
>>
>> --
>> Microsoft MVP - Windows PowerShell
>> http://www.microsoft.com/mvp
>> PowerGadgets MVP
>> http://www.powergadgets.com/mvp
>> Blog:
>> http://marcoshaw.blogspot.com
It would be for domain users. Quest CMDlets I will go and investigate, but
it would be nicer if it was something that was included in powershell. (I
don't know about you but I feel like I am forever installing bolt-ons for
psh). Any idea if there is going to be anything like this in PSH2?
What's the .Net option?
Much appreciated
"Brandon Shell [MVP]" wrote:
> Do you want local or domain accounts?
>
> for local you will need to use WMI or .NET
> for Domain you can use the free Quest CMDLets or .NET
>
> Brandon Shell
> ---------------
> Blog: http://www.bsonposh.com/
> PSH Scripts Project: www.codeplex.com/psobject
>
> m> It was really a powershell equivalent that passes out the result as
> m> an object. At the moment I have to parse the output with regex and I
> m> just think there must be an easier way.
> m>
> m> "Marco Shaw [MVP]" wrote:
> m>>
> >> malckelly wrote:
> >>
> >>> Is there an equivalent in powershell for doing
> >>>
> >>> "net user user1 /domain"
> >>>
> >>> or really just a "net user" command.
> >>>
> >> What were you looking to do? You can just use "net user user1
> >> /domain" from within PowerShell.
> >>
> >> The Quest AD cmdlets also provide a lot of information, and there's a
> >> free version:
> >> http://www.quest.com/powershell/
> >> Marco
> >>
> >> --
> >> Microsoft MVP - Windows PowerShell
> >> http://www.microsoft.com/mvp
> >> PowerGadgets MVP
> >> http://www.powergadgets.com/mvp
> >> Blog:
> >> http://marcoshaw.blogspot.com
>
>
You can use this
function Get-ADUsers{
Param($Dom)
if($Dom){$Dom = [ADSI]"LDAP://$dom"}else{$Dom = [ADSI]""}
$filter = "(&(objectcategory=user))"
$searcher = New-Object System.DirectoryServices.DirectorySearcher($Dom,$filter)
$searcher.pagesize = 1000
$searcher.findall()
}
Q: Any idea if there is going to be anything like this in PSH2?
A: I may be off base here, but my general feeling on this is the Powershell
Team is not going to provide this functionality and to be honest I agree
with that decision. IMO the Powershell team is directly responsible for the
Powershell framework and base CMDLets. Extenstions should be provided by
"Internal Third Party Teams" ie Exchange,Active Directory,SMS, MOM, and Office.
Treating internal products like external third party products is great. It
allows the Powershell team to focus on the actual functionality of Powershell
itself.
Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
m> It would be for domain users. Quest CMDlets I will go and
m> investigate, but it would be nicer if it was something that was
m> included in powershell. (I don't know about you but I feel like I am
m> forever installing bolt-ons for psh). Any idea if there is going to
m> be anything like this in PSH2?
m>
m> What's the .Net option?
m>
m> Much appreciated
m>
m> "Brandon Shell [MVP]" wrote:
m>
>> Do you want local or domain accounts?
>>
>> for local you will need to use WMI or .NET
>> for Domain you can use the free Quest CMDLets or .NET
>> Brandon Shell
>> ---------------
>> Blog: http://www.bsonposh.com/
>> PSH Scripts Project: www.codeplex.com/psobject
>> m> It was really a powershell equivalent that passes out the result
>> as
>> m> an object. At the moment I have to parse the output with regex
>> and I
>> m> just think there must be an easier way.
>> m>
>> m> "Marco Shaw [MVP]" wrote:
>> m>
>>>> malckelly wrote:
>>>>
>>>>> Is there an equivalent in powershell for doing
>>>>>
>>>>> "net user user1 /domain"
>>>>>
>>>>> or really just a "net user" command.
>>>>>
>>>> What were you looking to do? You can just use "net user user1
>>>> /domain" from within PowerShell.
>>>>
>>>> The Quest AD cmdlets also provide a lot of information, and there's
>>>> a
>>>> free version:
>>>> http://www.quest.com/powershell/
>>>> Marco
>>>> --
>>>> Microsoft MVP - Windows PowerShell
>>>> http://www.microsoft.com/mvp
>>>> PowerGadgets MVP
>>>> http://www.powergadgets.com/mvp
>>>> Blog:
>>>> http://marcoshaw.blogspot.com
malckelly wrote:I think the bolt-on thing is by design.. MS does provide some ADSI
> It would be for domain users. Quest CMDlets I will go and investigate, but
> it would be nicer if it was something that was included in powershell. (I
> don't know about you but I feel like I am forever installing bolt-ons for
> psh).
functionality built into powershell but really that is an odd fit, in
the future it will be a bolt-on from the active directory team i
suppose, and almost all other things will be a bolt-on for the
particular product akin to exchange for now. It would default the
purpose of powershell ,as a language and a base platform, to try to put
all functionality inside powershell itself, i think there is a
philosophical point here, but feel free to disagree
one good thing about powershell being built on the dotnet framework is
that you have a HUGE premade, prerequisite bolt-on already there. If it
wasn't for that, i think i'd be depending on an awful lot more snapins.
Karl
http://www.powershell.com
| Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| is there an equivalent Function to FORMAT(56,"0000") | magellan | VB Script | 9 | 24 Dec 2008 |
Can't access "Network and Sharing Center" nor "User Accounts" | newbie | General Discussion | 16 | 18 Oct 2008 |
| Vista's equivalent of "My Network places"? | Michael Moser | Vista networking & sharing | 2 | 31 Aug 2008 |
| powershell equivalent of "DIR \\server\path /A:D /S /B" | Ben Christian | PowerShell | 14 | 10 Mar 2008 |
| Is there an equivalent of the DOS shell "start /wait" in PowerShel | Brillig | PowerShell | 6 | 20 Jan 2007 |