Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

List all user attributes (including custom attributes) in a nested/recursive...

Hello,I am new to PowerShell. May I ask for help from someone here? Thanks.And now I am going to export all AD users belongs to a group called "lg_user" (no matter users are member of this group or its...

View Article


Register-ObjectEvent

I create an event subscriber using Register-ObjectEvent, I lose the Event as soon as I close the PS console (Get-EventSubscriber shows none). How do I make it permanent? It should not get affected by...

View Article


Get list of OUs then use in -Seachbase

Hello all,There seems to be a couple of ways to obtain all OUs with "something" in their name - in my case I'm seaching for all OUs called "XP" and then my aim is to discover if these OUs contain any...

View Article

VBA macro to Powershell

Would anyone be able to advise how to convert this VBA macro to powershell?  Thank you.ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$B$137"), , xlYes).Name = _        "Table2"...

View Article

How do cmdlets in the AD PowerShell module determine which DC to contact when...

I am having an issue with a number of the cmdlets in the module timing out semi-randomly since I migrated my admin machine to Windows 8. I did not have the problem with Windows 7 on the same...

View Article


Why does Select-Object return more than requested?

Why does the following command return more attributes than in the Select?$obj = Get-VM | Select VMName,State; $objVMName         : blah-blah State          : Off PSComputerName : host RunspaceId     :...

View Article

How do I format a custom PSObject correctly when I write to a text file?

Hello,The intent is to take a custom PSObject and format it correctly and 'nicely' in an output file.  When I execute the following, I get 3-4 spaces in between my output. One space between each line...

View Article

Modifying results from New-QADUser, Add-QADMemberOf, and Set-QADUser

Hello all,I have created a Powershell script to create new users and it is working without issue. I now have it logging the script and am wondering if there is a way to not show or alter the results...

View Article


regenerate SQL logins

I'm trying to use PS to enumerate all databases on a sql 2008R2 server and, for each database, generate the corresponding logins and permissions on new domain after migration my server via ADMT. I got...

View Article


Details of ShouldProcess?

Hi, I have been trying to understand the ShouldProcess pattern and how it changes when using the verbose, debug, whatif, and confirm parameters.  I'm trying to find a pattern to follow.  Here is a...

View Article

PowerShell HTTP 500 response error body

In PowerShell, I'm calling a SOAP web service and getting a HTTP 500 error at this line [System.Net.WebResponse]$resp=$webRequest.GetResponse()and $_  error object returns: The remote server returned...

View Article

how to convert unallocated disk space to a partition by using powershell

HiI am looking for a script (preferably PowerShell script) to check the server and if there is an unallocated disk space convert it to primary partition and bring it onlinethanks Reza Negarestani

View Article

Password Reset Self Service Portal

Hi Techies,we have hardly 2000 (windows server 2008 R2) users in my Org.. and we are using some third party software to reset users password when it expired.If the Passsword is not expired user login...

View Article


Get-ADuser Same Forest Cross Domain Search Fails

Hello!          I'm looking to copy AD attributes from one object in domain A to another object in domain B. Both are in the same forest and there aren't any permission problems, but I'm struggling...

View Article

Download and upload document from list library

Hi, I am using a powershell to upgrade a list template version from 3 to 4 but in this solution I have to download and upload manually the file (solution I am using:...

View Article


Joining data when nothing in common... Trying to combine PrimarySMTPAddress...

I know how to see how many items are in a folder:get-mailbox -server servernamehere | get-mailboxfolderstatistics -folderscope outbox | where-object {$_.itemsinfolder -gt 0} | ft identity,itemsinfolder...

View Article

Powershell Exchange 2010 Delete Folder in Mailbox / Or Delete Mail In Certain...

I can't seem to work out how to delete a certain folder in a mailbox. I'm importing a PST to a mailbox and ideally would be to use the -DeleteContent switch, but that cmdlet isn't available in Exchange...

View Article


RPC 0x80010108

$global:ie = New-Object -com "InternetExplorer.Application" $global:ie.Navigate("about:blank") $global:ie.visible = $true When does $global:ie get disconnected from the RPC server because I'm trying to...

View Article

Passing a ShouldProcess response down the call stack

Hi, does anybody know how to pass a ShouldProcess response to nested cmdlet and function calls?  Do cmdlets handle this already?  Can a function be written in such a way to accept a "yes to all" from...

View Article

Convert HTML issue

Hi,I got issue to convert it correctly to HTML. Appreciate any help on this.$MCount=(get-mailboxdatabase) | where-Object {$_.name -NotMatch "DB1" -And $_.name -NotMatch "DB2" -And $_.name -NotMatch...

View Article
Browsing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>