Tag Info

New answers tagged

2

That T in "VistaT" is no T at all - it represents a trademark symbol: ™ (U+2122 or #8482 in Unicode) Try this: Get-Computers -OperatingSystem $("Windows Vista" + [char]8482 + " Business") Why Microsoft chose to abuse the ability to store unicode symbols in string value attributes in this way is beyond me


2

I can't find a definitive answer...but I don't think this is available in "Windows Web Server". If you look here for instance at the comparison matrices you'll see that the Web version lacks most of the functionality that the Standard version and above includes. If the Module isn't listed as an option like you state, then it's likely not supported.


0

Look in C:\Windows\System32\WindowsPowerShell\v1.0\Modules and you should see a ServerManager folder. If you do not, then the module isn't available. As far as I know, this module is only available on 2008 R2 Standard and above. My 2008 (non-R2) server lacked it, but my standard one has it. Also, make sure you're using the 64-bit PowerShell and not 32-bit.


0

At the risk of shamelessly rep-whoring, here's a batch file that will return any directories that name `BUILTIN\IIS_IUSRS" with "Full Control" permission (with object and container inherit enabled): @echo off for /f "usebackq delims=" %%i in (`dir /ad /s /b`) do call :df "%%i" goto :EOF :df icacls %1 | find /i "BUILTIN\IIS_IUSRS:(OI)(CI)(F)" >NUL ...


0

Invoke-Command: http://technet.microsoft.com/en-us/library/hh849719.aspx From the help: The Invoke-Command cmdlet runs commands on a local or remote computer and returns all output from the commands, including errors. With a single Invoke-Command command, you can run commands on multiple computers. To run a single command on a remote ...


1

In the K1000 v6 software, the system automatically enables "require authentication to download backup images" -- one needs to disable that feature or switch to ftp if they want to download system backups going forward.


1

The last 2 lines of BackupScript.ps1 are Write-Host "Press any key to close ..." $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") Comment these out (or delete them) and scheduled jobs should complete and exit cleanly. If you really want the pause at the end, replace the last line with something like this to wrap a timeout around it (each sleep is 1 ...


-1

you have to add users on the winrm server to the group "Remote Management Users" It's that simple.


1

With 1000+ servers I assume you have a WSUS instance in your environment? You can get a lot of information from that with powershell. This is a snippet I use on our WSUS server (or via remote ps): $wsus = Get-WsusServer $servers = @("server1","server17","pol-server3","pol-server4") $servers | % { $servername = $_ $server = $wsus.GetComputerTargets() ...


0

You're attempting to get a remote server to do something on your behalf. Though mfinni is correct that this could be an SMTP problem, you may have hit the Double-Hop issue. Basically, the second server receives a 'less-powerful' authentication token, that prevents it from having the full-rights of someone who directly authenticated (a security measure used ...


0

It might be helpful too to add AD with this: import-module ActiveDirectory Then just use: Add-AdgroupMember MyList -member user.alias,user2.alias,user3.alias,... For this you do need RSAT installed (MS product, and free) or it won't work.


4

By combining 2 scripts found somewhere online, I managed to figure it out. This is the script that did the job. #Accept input parameters Param( [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)] [string] $Office365Username, [Parameter(Position=1, Mandatory=$true, ValueFromPipeline=$true)] [string] $Office365Password ) ...


0

To test an AD Object in general by DistinguishedName, you can use the following: [bool](Get-ADObject -Filter {DistinguishedName-eq "CN=Users,DC=domain,DC=local"}) Or, when you want to search by another property like samaccountname: [bool](Get-ADObject -Filter {sAMAccountname -eq "Administrator"}) Both will return only a boolean ($true or $false) and can ...


0

Public Folders changed dramatically in Exchange 2013, but coexistence of legacy public folders on older versions of Exchange (2007 and 2010) and Exchange 2013 is possible and supported. If you intend to keep the Exchange 2007 server around you can configure coexistence for legacy public folders. Outlook 2010 and 2013 clients will be able to access the public ...


3

No, you can't do this. Many of the PowerShell modules rely on OS-specific WMI namespaces. As these are not present in Windows 7, the modules cannot be imported. Powershell MVP Richard Siddaway details this in his blog.


0

I used this script to test all the .NET folders @echo off cd C:\Windows\Microsoft.NET\assembly\GAC_MSIL for /D %%z in (*) do ( echo %%z rename %%z %%z1 powershell 'powershell works' rename %%z1 %%z pause echo. ) Out of 236 folders, the only one that gave me error 80070002 was Microsoft.PowerShell.ConsoleHost You can repair PowerShell likes ...


0

Based on my observation of running Get-Cluster against a few of the clusters I have at work, it seemed to me that -Name uses name resolution, so if there's anything that causes a problem resolving names, it will fail even if the name you give it is the local machine. I tried it with cluster names and cluster service names as well as names of the individual ...


1

i do this in IIS 8 $testpool = get-item iis:\apppools\$iisAppPoolName; $testpool.processModel.userName = $un; $testpool.processModel.password = $pw; $testpool.processModel.identityType = 3; $testpool | Set-Item $testpool.Stop(); $testpool.Start(); Works for me :)


4

Mark, I had a lot of fun tracking this down for you. I can totally see where your line of thought is, but you're asking the wrong question. The question should be "Why can't I establish a 'servermanagerworkflows' session on my machine?" If you look in the $enf:systemroot\system32\WindowsPowerShell\v1.0\Modules\RemoteDesktop and open the ...


0

I believe I have a solution that will work, although it's not particularly pretty. jbsmith was on the right track. If I end up ACLing the powershell.exe to remove Execute permissions from the Users group, that stops them from running an interactive window. For those Powershell scripts that the users DO need to run via the login script, we can compile ...


2

Hi you might able to get the version with the following cmdlet Get-Host Work as well.


1

This isn't possible at the moment with the Registry resource, as you've discovered. You can use a Script resource or write a full custom resource instead.


-2

SSH and SFTP undoubtly represent industry standard in secure remote access application. Fortunally its possible that establishing a connect can be really quick and easy. Unfortunally the truth is that there are lot of possibilities to waste time with troubleshooting. Unfortunally Windows has no a standard ssh client or deamon software on board. This ...


2

You need DCOM ports and WSMan ports open. If you use Powershell v3+, by default DCOM range is 1024-5000, and WSMAN ports are 5985 (http) and 5986 (https). Hope it'll helps you. Regards


0

The powershell engine now offers the hooks to make this relatively straightforward but I don't know of anyone who has done it yet. The PSReadln project has an emergant emacs mode, though it is in its infancy. Adding a vi mode in PSReadln would be the obvious thing to do but I don't have time to devote to it.


0

Okay so I wrote the following powershell script to extract the date of most recent update from the log. There's a typo in the logging function of SCEP "succesfully" so when you notice that I also have a typo in my below code it's to match the one in the logs I am searching. $a=Select-String -Pattern "Update completed succesfully" -Path ...


5

I think you are misunderstanding the use of the -NonInteractive switch; you can still run powershell -noninteractive and get an interactive prompt. The noninteractive switch is intended for automated scripting scenarios, where you don't want powershell to send a prompt to the user and wait for a response. For example, in a non-interactive PowerShell window, ...


3

Are you running this from an account that has the permissions to read these ADUser properties? Do you, perhaps, need to elevate the Powershell session? I ran this on my 7000+ account domain and all values were either true or false, no blanks.


0

Well, according to this Technet Page on Forefront Enterprise Protection (Which is the same product as SCEP, which is the same product as Security Essentials, etc., etc.), the following log locations exist for the product, which you could parse with some PowerShell for the information you seek: %allusersprofile%\Microsoft\Microsoft Antimalware\Support Log ...


2

Yes, you can override Get-ChildItem or any other cmdlet in Powershell. Name Your Function The Same If you make a function with the same name in the same scope, yours will be used. Example: Function Get-ChildItem { [CmdletBinding()] param( # Simulate the parameters here ) # ... do stuff } Using Aliases Create your own function, and then create ...


3

Assuming you are talking about MS SQL. I don't think there is a way to tell just by looking at the file. This is why it's important to plan your backup process so as to take the guesswork out it, by using different file extensions like .bak, .diff, .trn, etc., to identify what type of file it is. Maybe you could try the restore verifyonly command: ...


0

I manage to do this with this powershell script. $root = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}' $items = Get-ChildItem -Path Registry::$Root -Name Foreach ($item in $items) { if ($item -ne "Properties") { $path = $root + "\" + $item $DriverDesc = Get-ItemProperty -Path ...


0

This was simple, I've changed the first line to this and everything works fine: $body = Get-mailbox | get-mailboxstatistics | sort-object totalitemsize –descending | Select-Object DisplayName,@{expression={$_.totalitemsize.value.ToMB()};label=”Mailbox Size (MB)”} | ConvertTo-Html | out-string The key point wast "Format-Table" doesn't play nice with ...


1

this is my solution thanks to briantist [CmdletBinding(DefaultParameterSetName="ComputerName")] Param ( # computername: Name of the host you want to connect to. [Parameter(Mandatory=$true,ParameterSetName="ComputerNameCred", Position=0)] [Parameter(Mandatory=$true,ParameterSetName="ComputerNamePlain", Position=0)] ...


0

The issue occurs if the package is not available or resides in the wrong directory PS C:\Windows\system32> Import-Module SSH-Sessions Import-Module : The specified module 'SSH-Sessions' was not loaded because no valid module file was found in any module directory. At line:1 char:1 + Import-Module SSH-Sessions + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ...


2

Yeah - have your exchange admin review the SMTP logs on the CAS server(s). Reviewing the logs is always the first thing to do. FYI - send-mailmessage will use your own AD credentials if you don't specify any, so you might be running into a problem where the receive connector is only allowing anonymous connections but you're using an authenticated session. ...


7

Hm, I think you have too many parameter sets. Also not sure why you have separate user/password parameters and a PSCredential parameter. You should really just use the PSCredential. But I'll assume you need this for some reason (please consider changing it). 4 parameter sets: ComputerNameCred ComputerNamePlain IpAddressCred IpAddressPlain function ...


0

Have you tried using Import-CLIXML instead of Get-Content? I don't know how well it handles big or complex xml files, but it's worth a shot.


1

If you process XML using non-XML-aware tools, you will always run this risk. If you want to do a transformation on XML, the best tool for the job is the XML transformation language, XSLT.


2

Out-File is writing a Unicode file by default. Use -Encoding to fix it: $temp = Get-Content .\bigxmlfile.xml $temp.replace("STRING1","STRING2") | out-file .\bigxmlfile.xml -force -encoding ascii Alternatively, use Set-Content: $temp = Get-Content .\bigxmlfile.xml $temp.replace("STRING1","STRING2") | set-content .\bigxmlfile.xml -force


1

Try giving PSEXEC from Sysinternals a shot: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx I do not have any experience with USMT. Place the USMT tool and the files it requires in c:\temp\usmtSource on the machine you want to drive the process from. You could then use powershell to read the CSV, and PSEXEC to make the invocation on the remote ...


1

Just sort the original csv (you can do without leading zeros): $data = Import-Csv first.csv $data = $data | Sort-Object {"{0:000}.{1:000}.{2:000}.{3:000}" -f @([int[]]$_.IP.split("."))} Now, since we've treated each part of the IP as an integer during sorting, they will be listed in the right order.


3

"ou=users" is not sufficient. You have to supply the full distinguished name of the OU you want the new account to be created in. It's also incorrect if you're talking about the Users container at the base of the domain, which is not an OU, but a container. Here are some examples. CN=Users,DC=domain,DC=com OU=MyOU,DC=domain,DC=com ...


-2

Did you try msinfo32.exe? Maybe third part software could show it like Lansweeper or aida64.


2

If you don't need to use $allusers as a collection of user objects multiple times (or if all you need is the names of users,) you can cut down on what you're storing in the shell's memory by doing this: $usernames = (get-aduser -Filter {Enabled -eq $true}).samAccountName $usernames.Contains("check_value") Or say you had an entire array of check values you ...


1

Counting through the array with ($i=0; $i ..., could be so much neater - PowerShell iterates through things quite nicely with foreach, but often you don't need that either. Your final code: $allusers= get-aduser -Filter {Enabled -eq $true} $usernames = @() for ($i=0; $i -le $allusers.length; $i++) { $usernames += $allusers[$i].SamAccountName } ...


3

You can use "select -expand xxx" to produced a flattened(?) array where you don't need to use the property name for parsing the array. $allusers = get-aduser -Filter {Enabled -eq $true} | select -expand samAccountName PS C:\> $allusers.contains("GeoSword") True


8

The problem comes with your Format-Table :) $allusers= get-aduser -Filter {Enabled -eq $true} | FT samAccountName $allusers | gm TypeName : Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Name MemberType Definition ---- ---------- ---------- Equals ...



Top 50 recent answers are included