Re: PowerShell noob help

2013-04-17 Thread James Rankin
Well that lil' bit of PS worked so well I did a blog post about it (naturally with appropriate credits) http://appsensebigot.blogspot.co.uk/2013/04/flagging-os-of-device-connecting-to.html This is about the time I will find out it doesn't work on anyone else's infrastructure and have to spend

Re: PowerShell noob help

2013-04-17 Thread Candee
AM *To:* NT System Admin Issues *Subject:* Re: PowerShell noob help ** ** Well that lil' bit of PS worked so well I did a blog post about it (naturally with appropriate credits) http://appsensebigot.blogspot.co.uk/2013/04/flagging-os-of-device-connecting-to.html

RE: PowerShell noob help

2013-04-17 Thread Michael B. Smith
...@googlemail.com] Sent: Wednesday, April 17, 2013 4:43 AM To: NT System Admin Issues Subject: Re: PowerShell noob help Well that lil' bit of PS worked so well I did a blog post about it (naturally with appropriate credits) http://appsensebigot.blogspot.co.uk/2013/04/flagging-os-of-device-connecting-to.html

Re: PowerShell noob help

2013-04-17 Thread Candee
that. ** ** *From:* Candee [mailto:can...@gmail.com] *Sent:* Wednesday, April 17, 2013 8:37 AM *To:* NT System Admin Issues *Subject:* Re: PowerShell noob help ** ** Okay you guys... here it is; credit card numbers changed to protect the innocent. ;) Any

RE: PowerShell noob help

2013-04-17 Thread Guyer, Don
@ 610-492-3839. [cid:image001.jpg@01CE3B5D.902FEBA0] From: Candee [mailto:can...@gmail.com] Sent: Wednesday, April 17, 2013 10:46 AM To: NT System Admin Issues Subject: Re: PowerShell noob help Thanks! I will see if I can figure out how. :) On Wed, Apr 17, 2013 at 9:19 AM, Michael B. Smith mich

Re: PowerShell noob help

2013-04-17 Thread Candee
: Description: Description: Description: InfoService-Logo240] ** ** *From:* Candee [mailto:can...@gmail.com] *Sent:* Wednesday, April 17, 2013 10:46 AM *To:* NT System Admin Issues *Subject:* Re: PowerShell noob help ** ** Thanks! I will see if I can figure out how

RE: PowerShell noob help

2013-04-17 Thread Guyer, Don
-3839. [cid:image001.jpg@01CE3B6E.6131FB70] From: Candee [mailto:can...@gmail.com] Sent: Wednesday, April 17, 2013 11:48 AM To: NT System Admin Issues Subject: Re: PowerShell noob help nah, I tried that. The column heading is employeenumber, but no data is exported. I have to add the attribute

Re: PowerShell noob help

2013-04-17 Thread Candee
yes; when the user is created, it shows up in AD - you don't need adsiedit, just check the attributes. I just can't seem to add it to the array and export it. On Wed, Apr 17, 2013 at 1:10 PM, Michael Leone oozerd...@gmail.com wrote: And you're sure this information has actually been stored in

Re: PowerShell noob help

2013-04-17 Thread Candee
:* Re: PowerShell noob help ** ** nah, I tried that. The column heading is employeenumber, but no data is exported. I have to add the attribute to the $creatednames array somehow. ** ** On Wed, Apr 17, 2013 at 11:20 AM, Guyer, Don dgu...@che.org wrote: Wouldn’t you just

RE: PowerShell noob help

2013-04-17 Thread Michael B. Smith
Add-Member -MemberType NoteProperty -Name EmployeeNumber ... :) From: Candee [mailto:can...@gmail.com] Sent: Wednesday, April 17, 2013 1:47 PM To: NT System Admin Issues Subject: Re: PowerShell noob help the problem is getting it in the array. I tried this at the top: $createdusers

Re: PowerShell noob help

2013-04-17 Thread Candee
** ** *From:* Candee [mailto:can...@gmail.com] *Sent:* Wednesday, April 17, 2013 1:47 PM *To:* NT System Admin Issues *Subject:* Re: PowerShell noob help ** ** the problem is getting it in the array. I tried this at the top: $createdusers = @() $employeenumber

RE: PowerShell noob help

2013-04-16 Thread Michael B. Smith
Start-Process gives you complete control over executing a separate task. If you don't need complete control, but just the text output, you don't need to do anything. $result = CTXCliOS.exe ^ | find ClientOS You can make it more PowerShell, if you want, but there isn't much

Re: PowerShell noob help

2013-04-16 Thread James Rankin
The problem I've got is that I have to call out of the console I am using to the command script file. If I write the same task in PowerShell, well the console natively supports it so it's easier for people to use it. I will have a bash around with that command to grab the output, cheers On 16

Re: PowerShell noob help

2013-04-16 Thread Ben Scott
On Tue, Apr 16, 2013 at 11:05 AM, James Rankin kz2...@googlemail.com wrote: for /f tokens=2 delims== %%a in ('CTXCliOS.exe ^| find ClientOS') do set ClientOS=%%a call :SET goto :eof :SET reg add HKCU\Software\Custom /v ClientOS /t REG_SZ /d %ClientOS% /f goto :eof What I'm wondering is

Re: PowerShell noob help

2013-04-16 Thread James Rankin
I've managed to use Select-String to get my output and my variable, it's splitting the variable up (from something like *ClientOS=ThinOS_Wyse* down to just *ThinOS_Wyse*) that's frying my brain now. I really should take reference publications kindly provided by people down the years with me onto

RE: PowerShell noob help

2013-04-16 Thread Webster
Ask Web about the things I've shown him the last year How about just in the last three weeks!!! :) Carl Webster Consultant and Citrix Technology Professional http://www.CarlWebster.comhttp://www.carlwebster.com/ From: Michael B. Smith [mailto:mich...@smithcons.com] Subject: RE: PowerShell

RE: PowerShell noob help

2013-04-16 Thread Michael B. Smith
-ExitCodeAndOutput: exit, exit = $($exit.ToString()) return $exit } From: James Rankin [mailto:kz2...@googlemail.com] Sent: Tuesday, April 16, 2013 11:54 AM To: NT System Admin Issues Subject: Re: PowerShell noob help The problem I've got is that I have to call out of the console I am

RE: PowerShell noob help

2013-04-16 Thread Michael B. Smith
$result = $clientOS.SubString( 9 ) From: James Rankin [mailto:kz2...@googlemail.com] Sent: Tuesday, April 16, 2013 12:08 PM To: NT System Admin Issues Subject: Re: PowerShell noob help I've managed to use Select-String to get my output and my variable, it's splitting the variable up (from

Re: PowerShell noob help

2013-04-16 Thread Ben Scott
On Tue, Apr 16, 2013 at 12:00 PM, Ben Scott mailvor...@gmail.com wrote: I'm having trouble figuring out how to get the regexp capture out of the $match object returned by Select-String though. Ah, okay, this seems to work: $match = CTXCliOS.exe | Select-String -Pattern 'ClientOS\s+(.+)'

Re: PowerShell noob help

2013-04-16 Thread Ben Scott
On Tue, Apr 16, 2013 at 12:07 PM, James Rankin kz2...@googlemail.com wrote: I've managed to use Select-String to get my output and my variable, it's splitting the variable up (from something like ClientOS=ThinOS_Wyse down to just ThinOS_Wyse) that's frying my brain now. Ah, I ass-umed the

Re: PowerShell noob help

2013-04-16 Thread Ben Scott
On Tue, Apr 16, 2013 at 12:14 PM, Michael B. Smith mich...@smithcons.com wrote: This should help. “msg” is just a function that logs all of its arguments to a text file. Hey... this is kind of a threadjack, but your sample code here makes me think of it. In a PoSh script I'm evolving, I'm

Re: PowerShell noob help

2013-04-16 Thread James Rankin
16, 2013 11:54 AM *To:* NT System Admin Issues *Subject:* Re: PowerShell noob help ** ** The problem I've got is that I have to call out of the console I am using to the command script file. If I write the same task in PowerShell, well the console natively supports it so it's easier

Re: PowerShell noob help

2013-04-16 Thread James Rankin
I'll give that a try too...luckily the software I am using means it is no problem to ensure the Registry key exists before running my script :-) On 16 April 2013 17:18, Ben Scott mailvor...@gmail.com wrote: On Tue, Apr 16, 2013 at 12:00 PM, Ben Scott mailvor...@gmail.com wrote: I'm

Re: PowerShell noob help

2013-04-16 Thread James Rankin
Ben, you're a wizard, that worked first time out :-) I know MBS is going to be unimpressed by you simply slinging me a landed fish, but it's nearly 6pm here so I am quite happy to accept! Now to go back to my hotel and try and do a bit more PowerShell learning (after the football) Thanks all!

RE: PowerShell noob help

2013-04-16 Thread Michael B. Smith
Issues Subject: Re: PowerShell noob help Thanks for the pointers Is it just me getting old or do newer scripting languages always look so much more complicated at first glance? :-) Cheers, JR On 16 April 2013 17:14, Michael B. Smith mich...@smithcons.commailto:mich...@smithcons.com wrote

RE: PowerShell noob help

2013-04-16 Thread Michael B. Smith
Subject: Re: PowerShell noob help On Tue, Apr 16, 2013 at 12:14 PM, Michael B. Smith mich...@smithcons.com wrote: This should help. msg is just a function that logs all of its arguments to a text file. Hey... this is kind of a threadjack, but your sample code here makes me think

Re: PowerShell noob help

2013-04-16 Thread Ben Scott
On Tue, Apr 16, 2013 at 12:59 PM, Michael B. Smith mich...@smithcons.com wrote: Some of these functions return values, which are captured into variables by the caller. But these functions also want to inform the user of what's going on. *And*, I'd also like to be able to optionally redirect

Re: PowerShell noob help

2013-04-16 Thread Ben Scott
On Tue, Apr 16, 2013 at 12:57 PM, James Rankin kz2...@googlemail.com wrote: Ben, you're a wizard, that worked first time out :-) I am but a humble student. Indeed, I'm getting my feet wet with PoSh for real use for the first time these past few weeks. Part of the reason I did this was to

Re: PowerShell noob help

2013-04-16 Thread kz20fl
-- From: Ben Scott To: NT System Admin Issues ReplyTo: NT System Admin Issues Subject: Re: PowerShell noob help Sent: 16 Apr 2013 19:11 On Tue, Apr 16, 2013 at 12:57 PM, James Rankin kz2...@googlemail.com wrote: Ben, you're a wizard, that worked first time out :-) I am but a humble student

Re: PowerShell noob help

2013-04-16 Thread Candee
So... now that you mention it. ;) I'm knee deep in the first real-world task of creating a powershell script. I will be happy to accept a nudge in the right direction (or a cluex4, if I'm missing the obvious) The script imports user data from a csv; and uses that data to create their username and

RE: PowerShell noob help

2013-04-16 Thread Guyer, Don
: 610.955.6528 | Fax: 610.271.9440 For immediate assistance, please open a Service Desk ticket or call the helpdesk @ 610-492-3839. [cid:image001.jpg@01CE3AB8.9597F380] From: Candee [mailto:can...@gmail.com] Sent: Tuesday, April 16, 2013 3:26 PM To: NT System Admin Issues Subject: Re: PowerShell noob help

RE: PowerShell noob help

2013-04-16 Thread Damien Solodow
: Re: PowerShell noob help So... now that you mention it. ;) I'm knee deep in the first real-world task of creating a powershell script. I will be happy to accept a nudge in the right direction (or a cluex4, if I'm missing the obvious) The script imports user data from a csv; and uses that data

Re: PowerShell noob help

2013-04-16 Thread Candee
a Service Desk ticket or call the helpdesk @ 610-492-3839.* [image: Description: Description: Description: InfoService-Logo240] ** ** *From:* Candee [mailto:can...@gmail.com] *Sent:* Tuesday, April 16, 2013 3:26 PM *To:* NT System Admin Issues *Subject:* Re: PowerShell noob help

RE: PowerShell noob help

2013-04-16 Thread Guyer, Don
: 610.271.9440 For immediate assistance, please open a Service Desk ticket or call the helpdesk @ 610-492-3839. [cid:image001.jpg@01CE3AB9.BC1003D0] From: Damien Solodow [mailto:damien.solo...@harrison.edu] Sent: Tuesday, April 16, 2013 3:43 PM To: NT System Admin Issues Subject: RE: PowerShell noob help

RE: PowerShell noob help

2013-04-16 Thread Guyer, Don
: 610.271.9440 For immediate assistance, please open a Service Desk ticket or call the helpdesk @ 610-492-3839. [cid:image001.jpg@01CE3AB9.19678AE0] From: Guyer, Don Sent: Tuesday, April 16, 2013 3:39 PM To: NT System Admin Issues Subject: RE: PowerShell noob help What is Employeenumber, a custom

Re: PowerShell noob help

2013-04-16 Thread Ben Scott
On Tue, Apr 16, 2013 at 3:25 PM, Candee can...@gmail.com wrote: Everything works, except the employeenumber ... ... Any ideas to get the employeenumber to export? I was waiting for someone with a clue to reply, but perhaps they're all busy today. :-) So... Not knowing what I'm doing, I'd