Search found 63 matches
- Wed Jan 17, 2018 6:15 am
- Forum: PowerShell
- Topic: Need some help with RegEx
- Replies: 4
- Views: 1957
Re: Need some help with RegEx
For remote computers so I was going to use this code $script:computer = 'Server1' $script:user = (Get-ChildItem \\$computer\C$\users | Sort-Object LastWriteTime | Select-Object -last 1 ).name $objUser = New-Object System.Security.Principal.NTAccount("$user") $strSID = $objUser.Translate([System.Secu...
- Tue Jan 16, 2018 7:59 pm
- Forum: PowerShell
- Topic: Need some help with RegEx
- Replies: 4
- Views: 1957
Need some help with RegEx
I'd like to make this - This is how our printers show in our registry. So I just want to pull the name of the printer.
,,server.printers.net,NYC0304-SILVER-MFD
Into this
NYC0304-SILVER-MFD
,,server.printers.net,NYC0304-SILVER-MFD
Into this
NYC0304-SILVER-MFD
- Tue Jan 16, 2018 9:46 am
- Forum: PowerShell GUIs
- Topic: Combobox - Readonly Property Possible?
- Replies: 4
- Views: 2044
- Tue Jan 16, 2018 9:20 am
- Forum: PowerShell GUIs
- Topic: Combobox - Readonly Property Possible?
- Replies: 4
- Views: 2044
Re: Combobox - Readonly Property Possible?
That's a very good hint J gave you 
It's 100% there

It's 100% there
- Thu Jan 11, 2018 10:25 am
- Forum: PowerShell
- Topic: Get Mapped Drives using .net
- Replies: 14
- Views: 4845
- Thu Jan 11, 2018 8:39 am
- Forum: PowerShell
- Topic: Get Mapped Drives using .net
- Replies: 14
- Views: 4845
Re: Get Mapped Drives using .net
This is my completed script $script:computer = 'Server1' $script:user = Invoke-Command -ComputerName $computer -ScriptBlock { (Get-ChildItem C:\users | Where { $_.Name -ne $env:USERNAME }).name | Select-Object -last 1 } $objUser = New-Object System.Security.Principal.NTAccount("$user") $strSID = $ob...
- Wed Jan 10, 2018 4:07 pm
- Forum: PowerShell
- Topic: Get Mapped Drives using .net
- Replies: 14
- Views: 4845
Re: Get Mapped Drives using .net
I think you determined I needed the SID but I never stated that my friend
I just wanted to create a faster script than what I linked to using remote registry
Just hung up on creating a data set to import into my DGV
Thanks for the attempt. Sorry I didn't make it clear enough for you.
I just wanted to create a faster script than what I linked to using remote registry
Just hung up on creating a data set to import into my DGV
Thanks for the attempt. Sorry I didn't make it clear enough for you.
- Wed Jan 10, 2018 2:20 pm
- Forum: PowerShell
- Topic: Get Mapped Drives using .net
- Replies: 14
- Views: 4845
Re: Get Mapped Drives using .net
Hmm, not sure where you see I typed Drivers but I did come to this solution So it's working in the ISE but it only returns the length in a DGV $computer = 'Server1' $regkey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::Users, $Computer) $ref = $regKey.OpenSubKey(...
- Wed Jan 10, 2018 2:01 pm
- Forum: PowerShell
- Topic: Get Mapped Drives using .net
- Replies: 14
- Views: 4845
Re: Get Mapped Drives using .net
I repeat ... What is it you are looking for a solution to? What is the purpose of this? Show technicians the drives and the paths so our build guys can map them Yes, I can export the registry but that will map drives they may no longer have access to.. So in our form if I put Z: \\server1\accountin...
- Wed Jan 10, 2018 1:50 pm
- Forum: PowerShell
- Topic: Get Mapped Drives using .net
- Replies: 14
- Views: 4845
Re: Get Mapped Drives using .net
What is it you are looking for a solution to? What is the purpose of this? If a user connects over a VPN they are not logged into a remote system. All drives are mapped locally over the VPN. Get-PsDrive is all you need. Trying to return the Drive and Path of a logged on users network drives from HK...