Reply To: Problem with certbased authentication at powershell remoting
From what I can see here, it looks like you're doing things correctly. Just to double check, please run the following commands and let me know their output: # On server.fqdn: (Get-Item...
View ArticleLogging Function / Module
Hey everyone I'm curious what people here use for robust logging. I've been searching for ways to incorporate logging into my scripts. For example, I'm looking for a consistent way to log data to a...
View ArticleReply To: Logging Function / Module
Here's what I use: http://gallery.technet.microsoft.com/Enhanced-Script-Logging-27615f85 If you use the *-LogFile cmdlets, you get the default behavior, which is to prepend a date / time stamp to each...
View ArticleImporting Module
Im finally coming here for help, I understand the basics of importing a module. But in my current situation I need to import a module from a shared network drive, from a computer that is not on the...
View ArticleReply To: Importing Module
You can map a drive from a script in a few different ways, but you're also going to need to store the username and password used to map the drive, in some way. There are various methods to accomplish...
View ArticleReply To: VBS to PowerShell
Pranab, This part defines a hashtable of keys and values. @{ 'Region' = $Group.Region 'Group' = $Group.Group 'ActivePolicy' = $Policy.Split( "/", 2 )[1] } Putting the [pscustomobject] variable type in...
View ArticleReply To: Correct way to use the Group Resource
I get this error message: The PowerShell provider MSFT_GroupResource threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW...
View ArticleReply To: Correct way to use the Group Resource
What is the error in the Microsoft-Windows-DSC/Operational (Applications and Services Logs > Microsoft > Windows > Desired State Configuration > Operational) event log?
View ArticleReply To: Set-ADAccountPassword Issue
Hey Alex, Couple of suggestions (1) If you're able to, try disabling UAC on a DC restart it. I've seen this happen even when PowerShell is launched as an Administrator (2) If you are using a variable...
View ArticleReply To: How to process multiple ValidationSet parameter attribute values...
Of course they don't, just wanted confirmation. Thanks man
View ArticleProcess multiple ObjectCategory values using Get-ADObject cmdlet
I would like to get output for multiple "ObjectCategory" values using the Get-ADObject cmdlet and it doesn't work if I create an array as in the following example: $Object = @("computer", "group")...
View ArticleReply To: Process multiple ObjectCategory values using Get-ADObject cmdlet
The -Filter parameter is processed at the DC – and the DC isn't capable of handling variables. Further, the DC can't process an array. You'd need to run this as multiple queries, or construct a much...
View ArticleReply To: Real life examples of the xPackage Resource
I think your long-term solution will be OneGet. Name is arbitrary, in most of the cases I've seen. ProductID is the ProductID from the Windows Installer database. And, the package resource ought to be...
View ArticleReply To: AdComputer
Use "Select -expandproperty name" instead of "Select -property name". $names = Get-ADComputer -filter * -searchbase "ou=a,dcdomain,dc=local" | select -expand name foreach ($name in $names) { }
View ArticleReply To: AdComputer
Tnx, I see your powershell in lunch Why the different ? what the different between -expandproperty and -property ? sincerity Itamar
View ArticleReply To: Process multiple ObjectCategory values using Get-ADObject cmdlet
Okay, that is what I thought. Thanks DJ, I appreciate it brother.
View ArticleReply To: Process multiple ObjectCategory values using Get-ADObject cmdlet
You should be able to construct a filter with multiple checks on object categories joined by -or . (You can do this in the LDAP filter syntax, or with -Filter; whatever your preference.) If you want...
View ArticleReply To: AdComputer
The difference is that with -ExpandProperty you get an array of strings that represent names whereas if you just use -Property you will get an array of custom objects that contain a name column....
View ArticleUnderstanding switch parameters
I thought if you use a switch parameter you don't have to specify whether the parameter is true or false, but rather just using the parameter itself tells PowerShell that it is true. For instance, if...
View ArticleReply To: Understanding switch parameters
Sorry, not explicitly as $false, but $true. That was a typo
View Article