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

how check Powershell Version ?

$
0
0

Hi...all

I installed SQL Server 2008 Dev edition on XP sp3.(It Installs WPS)

I am very much new to PS..I started testing my Installation.

For example, I typed Get-PS and press the Tab key , 
the following cmdlets are appearing

Get-PSDrive
Get-PSProvider
Get-PSSnapin

But It suppose to show below list 

❑ Get-PSBreakpoint
❑ Get-PSCallStack
❑ Get-PSDrive
❑ Get-PSProvider
❑ Get-PSSession
❑ Get-PSSessionConfiguration
❑ Get-PSSnapin

Why some other cmdlets are missing...Help me how to resolve and how check the Present version of WPS.

Thanks in Advance




SNIVAS

New-MoveRequest

$
0
0
I am trying to script the move of a mailbox from Office 365 back to onprem exchange. I have the command to move the mailbox down, but I have no idea how to have this script send an alert after the move is complete. The GUI in Office 365 makes you send an email to someone when your migration is complete. How is it Microsoft didn't think to build this into the powershell command New-MoveRequest? Any help is appreciated. 

Laurence Leiter

Hit a snag creating users via AD in powershell, Looking for some help if poss! Thanks

$
0
0

Hi Guys,

Hoping someone can help. Following an online course and part of it is to create a user with powershell. I've got so far with it and have fallen at the final hurdle it seems. Here is the code:

# import active directory module
Import-Module ActiveDirectory

# store users first name into variable 
$firstname = Read-Host -Prompt "Please enter your first name"
$lastname = Read-Host -Prompt "Please enter your last name"
$password = Read-Host -Prompt "Please enter your password"

# Output the users information
echo "your full name is $firstname $lastname. Your password is $password"

# Specify where to store the user account
$OUpath = "OU=Powershell Users,DC=itflee,DC=com"

# Convert the Password to a secure string
$securePassword = ConvertTo-SecureString $password - AsPlainText -Force

# Create the user account
New-ADUser -Name "$firstname $lastname" -GivenName "$firstname" -Surname "$lastname" -UserPrincipalName "$firstname.$lastname" -Path $OUpath -AccountPassword $securePassword -ChangePasswordAtLogon $true -Enabled $true

Yet this fails! initially I thought it was the PW I was using wasn't complex enough however I tried a crazy stupid one on my screenshot examples to prove a point.

Can anyone advise me where I'm going wrong? 

Thanks!



problem with return values

$
0
0

I have a add-type which is written in C#

When I a call function directly it retains the type.

$Var = [MyLibrary.Utils]::SomeFunction()

$Var.GetType()  returns [MyLibrary.SomeCollection] That's good and it works.

But when I go through a powershell function it does not work

Function Get-Data {
   $V = [MyLibrary.Utils]::SomeFunction()
   return $V
}

$Var = Get-Data
$Var.GetType  returns [System.Object[]]


I have tried casting it.

Function Get-Data {  [OutputType([MyLibrary.MyCollection])]  Param ()
  $V = [MyLibrary.Utils]::SomeFunction()
  return $V
}
$Var = Get-Data
$Var.GetType  still returns [System.Object[]]

And finally I cast it on both sides of the call.

Function Get-Data {
  [OutputType([MyLibrary.MyCollection])]
  Param ()
  $V = [MyLibrary.Utils]::SomeFunction()
  return $V
}
[MyLibrary.MyCollection]$Var = Get-Data

That throws an error 

Cannot convert the "System.Object[]" value of type "System.Object[]" to type "MyLibrary.MyCollection"

Is it suppose to do this? Am I missing something?



How to retain the order of the psobjects passed into a function?

$
0
0

I have the following script that gets objects from another scripts and converts it to a pscustomobject

& ".\script1.ps1" -ViewConnection "$cinput" -OutVariable xprtOut | Format-Table -Wrap

#converting xprtOut from Arraylist to pscustomobject to be used with ConvertTo-HTMLTable
$Arr = @()
foreach ($Object in $xprtOut) {
    $i = -1
    $arrayListCount = -($Object | gm | Where-Object {$_.MemberType -like "noteproperty"}).Count

    $customObj = New-Object PSCustomObject
    do {
        $customObj | Add-Member -MemberType NoteProperty -Name (($Object | gm)[$($i)].Name) -Value ($Object."$(($Object | gm)[$($i)].Name)")
        $i--
    } while ($i -ge $arrayListCount)

    $Arr += $customObj
}

it works great and all but i notice the ordering of the objects changes. how can i preserve the ordering in the function?

i am trying the answer here: https://stackoverflow.com/a/42300930/8397835

$Arr += [pscustomobject]$customObj

but that doesnt work. i tried placing the cast elsewhere in the function and gave out errors.

The ordered attribute can be specified only on a hash literal node.

i guess i am not sure where am i supposed to place the [ordered] or [pscutomobject] in the function since in my case i dont have @ symbol

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

$
0
0

I'm using below query for download but i got below error can you please suggest me how to resolve this issue.

Query:

(new-object -comobject "microsoft.update.session").CreateUpdateDownloader()

Error:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

At line:11 char:5
+     $downloader = $updateSession.CreateUpdateDownloader()


copying files between two phrases

$
0
0

Hello Team,

Please help me with the below requirment,

From The below text, i need to copy only the certificate details using a powershell script. Can you please give me the regular expression that will help me to find out the words between (-----BEGIN CERTIFICATE-----   and -----END CERTIFICATE-----) i.e. the certificate from the below raw data.

==================================================

CONNECTED(00000184)
---
Certificate chain
 0 s:/C=US/ST=California/L=Mountain View/O=Google LLC/CN=*.google.com
   i:/C=US/O=Google Trust Services/CN=Google Internet Authority G3
 1 s:/C=US/O=Google Trust Services/CN=Google Internet Authority G3
   i:/OU=GlobalSign Root CA - R2/O=GlobalSign/CN=GlobalSign
---
Server certificate
-----BEGIN CERTIFICATE-----
MIII2zCCB8OgAwIBAgIQOGsBet/MsOThCgO8ib3bKjANBgkqhkiG9w0BAQsFADBU
MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMSUw
IwYDVQQDExxHb29nbGUgSW50ZXJuZXQgQXV0aG9yaXR5IEczMB4XDTE5MDYxODA4
MjkxM1oXDTE5MDkxMDA4MTYwMFowZjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNh
bGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxEzARBgNVBAoMCkdvb2ds
ZSBMTEMxFTATBgNVBAMMDCouZ29vZ2xlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQAD
ggEPADCCAQoCggEBAJl+ihJXEAC3d+WkHaZ8BChFb0Qbcrwx53qvEsQlhWTVvWSi
d97Hml7ho01+JNrY++qmmO69bx7aE2+FRAHwmfxWyVAy3ZsnE9WFiJxd/g19Uk9I
Q2YSWd4umAkOB1MMP9+1qpDy312tQ/uX44dgCx6NgwqnlnsGWuiqFgiyI194rOvL
7m4o/000fDkXH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Gtlhz+7xDAnzpIXDlF0D6X
4EY97UeoLg3D9h0deco1Uw3IByg0MVvLwTxZumCT9ftvTECsNcRLiAdUI/tCXT/7
cXB3HBW69wFYT4RP7CtcQhTY+ZFmqa8At9R/WaiMvPrEkuJQ2WK7nNiccmA8KbOR
eXP1jhscQl75RSyYJ91vvGx+WxLPhHGG/KfgqH6W8KBo8Km1Fmv95R9S1oYsM6RM
1s7KKKM6yKOEPB9iMRzutOIhKAkFGlj3s28vTqyDAuiEL714UcwWKKbtOmrYioVe
+idGN+nL2/3ykaUhCauP
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Mountain View/O=Google LLC/CN=*.google.com
issuer=/C=US/O=Google Trust Services/CN=Google Internet Authority G3
---
No client certificate CA names sent
Peer signing digest: SHA256
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 4099 bytes and written 433 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: 8820359AEB557BE3F51F6EB080EDD2C2A4C3DED3C7A42ACF39CF9CC2D85D17B6
    Session-ID-ctx: 
    Master-Key: FE30372ADE34934884F2C6521EE3986E696261AFC47A674BFBF9B4C1252D4386DE1D3FF718A28089AC7692FB5A4793E3
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 100800 (seconds)
    TLS session ticket:
    0000 - 00 ea 62 71 13 be 34 95-97 3c c2 e1 aa 02 ae ba   ..bq..4..<......
    0010 - e0 f8 d7 94 86 1d 4d 66-9d 6d df bf 0d 34 fd c9   ......Mf.m...4..
    0020 - 5d ee 9d f3 eb 15 ae 0e-35 76 82 c9 51 27 7e 04   ].......5v..Q'~.
    0030 - 74 30 6d 32 cd 69 88 3d-f3 fb 64 3e b7 29 93 db   t0m2.i.=..d>.)..
    0040 - 6a 5b f4 88 71 26 dc 24-7f 97 81 39 72 a3 a6 3c   j[..q&.$...9r..<
    0050 - aa 66 ab 37 03 80 4e 81-78 82 e7 79 33 df 94 90   .f.7..N.x..y3...
    0060 - 41 73 a9 1d 67 72 61 96-f3 b7 14 f7 94 12 17 e1   As..gra.........
    0070 - 5e 34 7a 80 c4 9e f7 39-f0 4f e5 e1 02 38 e4 0a   ^4z....9.O...8..
    0080 - e4 6d 3c 4c b4 66 26 28-d2 2a e5 8e bc 09 31 f0   .m<L.f&(.*....1.
    0090 - bf 1a 2d 67 69 ce 61 f4-8b d5 c7 98 96 f7 ec e1   ..-gi.a.........
    00a0 - 0c 13 14 a7 d7 98 2e ec-c4 96 94 9c a4 7a ed 00   .............z..
    00b0 - d6 34 d7 f4 b2 7a 29 56-20 c1 27 5c 5e c7 81 aa   .4...z)V .'\^...
    00c0 - e6 f6 90 74 eb df ee 59-b0 6a d3 fc ba 79 26 79   ...t...Y.j...y&y
    00d0 - 8e 38 48 88 95                                    .8H..

    Start Time: 1563192567
    Timeout   : 300 (sec)
    Verify return code: 20 (unable to get local issuer certificate)
---

======================================================

Kind Regards

Sreeram.R


Shriram

who's running an app

$
0
0

Windows 10 Pro with Shared Computer 

Several users logging into a Shared PC with User switching and leaving applications open

I'm using this to find out who is NOT quitting out of programs.

Custom VB app linked to Access MDB

gwmi win32_process -filter 'name="cust.exe"'|%{$_.GetOwner()}|select domain,user

works fine if I replace the cust.exe with notepad.exe


ChrisS



Enter-PSSession: WinRM cannot process the request, Kerberos authentication error 0x80090322

$
0
0

Hi!

I've configured PowerShell Remoting on the server using Enable-PSRemoting commandlet.

But when I'm trying to connect to the server I'm constantly getting the following error:

PS C:\Users\sergeyp> Enter-PSSession SERVERNAME.DOMAINNAME.com
Enter-PSSession : Connecting to remote server SERVERNAME.DOMAINNAME.com failed with the following error message : WinRM cannot process the request. The following error
with errorcode 0x80090322 occurred while using Kerberos authentication: An unknown security error occurred.
 Possible causes are:
  -The user name or password specified are invalid.
  -Kerberos is used when no authentication method and no user name are specified.
  -Kerberos accepts domain user names, but not local user names.
  -The Service Principal Name (SPN) for the remote computer name and port does not exist.
  -The client and remote computers are in different domains and there is no trust between the two domains.
 After checking for the above issues, try the following:
  -Check the Event Viewer for events related to authentication.
  -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport.
 Note that computers in the TrustedHosts list might not be authenticated.
   -For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1+ Enter-PSSession SERVERNAME.DOMAINNAME.com+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : InvalidArgument: (SERVERNAME.DOMAINNAME.com:String) [Enter-PSSession], PSRemotingTransportException+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Also, in the System event log on a client computer I see the Security-Kerberos error described here:
http://technet.microsoft.com/en-us/library/52ddf7d9-a0e7-4c9d-be3c-3c35219f2d69.aspx

Error details:

Log Name: System Source: Microsoft-Windows-Security-Kerberos Date: 2/22/2013 1:42:39 PM Event ID: 4 Task Category: None Level: Error Keywords: Classic User: N/A Computer: ... Description:

The Kerberos client received a KRB_AP_ERR_MODIFIED error from the server
SERVERNAME$. The target name used was HTTP/SERVERNAME.DOMAINNAME.com.
This indicates that the target server failed to decrypt the ticket
provided by the client. This can occur when the target server principal
name (SPN) is registered on an account other than the account the target
service is using. Please ensure that the target SPN is registered on,
and only registered on, the account used by the server. This error can
also happen when the target service is using a different password for
the target service account than what the Kerberos Key Distribution
Center (KDC) has for the target service account. Please ensure that the
service on the server and the KDC are both updated to use the current
password. If the server name is not fully qualified, and the target
domain (DOMAINNAME.COM) is different from the client domain
(DOMAINNAME.COM), check if there are identically named server accounts
in these two domains, or use the fully-qualified name to identify the
server.
...

And... I have identical WinRM configuration on the other server, and it works fine.

I'm using Windows Server 2008 Standard SP2 and PowerShell 3.0.

I'm logging in as a domain user.

Both client and server are in the same domain.

The SPN HTTP/SERVERNAME.DOMAINNAME.com doesn't exist, but the corresponding SPN also doesn't exist for the computer on which PS Remoting works fine!

Could somebody help me with identification of this error source, please?


PowerShell script to Auto Logoff Admin Users if login > 2 days and session is inactive

$
0
0

Hi All

 I was wondering if anyone could help me with this script. What i am trying to do its log off all inactive user login  more-than 2 days. If anyone has any insight it would be greatly appreciated.

 Thanks

Aditya Dugyala

Power Shell to nest multiple GG and DLG groups

$
0
0

Dear Experts

I am trying to find if there is a quick way to nest multiple AD groups( Global Group:GG) within their corresponding Domain Local Groups( DLG)

I would like to feed the data using CSV with columns GG & DLG group names. so GG1 should be nested within DLG1 and so on.

Please advise.

Thanks

Shyam

Foreach loops output in Different files.

$
0
0

Hello Team,

As a project requirement, i need the output of a foreach loop to be saved in a different file. (i.e). If a loop runs 100 times the output of the each instance of loop should be saved in a different file, So that i may get 100 output files.

I do not want to use "append" option, Since this dumps everything into a single file.

Kind Regards

Sreeram.R


Shriram

PowerShell to move folders to remote server and execute batch files

$
0
0

Hi.

I have more than 7 test servers to which I would need to copy files and folders from development server . Once the files are copied, the batch files inside the folder need to be executed.

I am looking for PowerShell script , which can copy folder containing SSIS package files, xml configuration and batch scripts. Copy the folder from one remote desktop server to another ( Dev server to test server ) and execute the batch files without manual intervention. Are there code samples available to achieve this in PowerShell ?

Thanks

Script RDP connexion that start another RDP connexion

$
0
0

Hi all,

I'd like to find a script that will create an RDP connexion to a server1, and from this server1 the script must create another RDP connexion from a server2.

I can't create an RDP connexion to server2 directly because of firewall rules. so i have to pass through server1.

I'd like that when i start my script i'm reaching server2 directly (as if server1 doesn't exist)

I hope i'm clear enough.

Thx for your help.


s


How to update static DNS IPs for servers in specific OU in Active Directory

$
0
0
I am trying to update static DNS IP addresses for all my servers in specific OU in Active Directory. I need help putting the GetComputer command with the Set-DNSClientServerAddress command so that I can only update the handful of servers I need to from old DNS IPs to new. 

Powershell script to read coulumn 2 data from .xlsx file

$
0
0

I'm trying to write a PowerShell script to get of 2 column of a .xlsx file. Can anyone help me here.

My .xlsx file looks like below

ProductNameProductCodeJava7 Update 75{26374892-xxxx-xxxx-xxxx-123456789012}Java8 Update 25 {26374892-xxxx-xxxx-xxxx-902341562789}

I want output which will write only product codes line by line
{26374892-xxxx-xxxx-xxxx-123456789012}
{26374892-xxxx-xxxx-xxxx-902341562789}




Powershell Users in a Group list and then export users recursive

$
0
0

Hi,
I am wanting to find out how to put the two together. I have the following script for finding users/groups that have access to certain folders.

$project_folder = "\\UNC PATH"
get-acl $project_folder | %{ $_.Access  } | ft -property IdentityReference, AccessControlType, FileSystemRight

and then the following for finding AD Groupmembers with the recursive parameter

Get-ADgroupmember -identity “ADGroupmember” -Recursive | get-aduser -property displayname | select name, displayname >C:\output\Members.txt

How can I put the two together so I get a list of all users/groups by using the first script to list them and then list all the users in that are in any groups to a txt file...

PS - Powershell noob.


Thanks

How come I cannot run this basic powershell command?

$
0
0

Hi - I'm just trying to get used to running some basic troubleshooting commands in powershell so wanted to load up the logs. I tried a couple from Event viewer. System I can kind of understand but what about the SECURITY log? Do certain services have to be stopped before running the security log for troubleshooting purposes? 

Thanks in advance

Simple search and replace items from a SharePoint list using powershell

$
0
0

The script works fine replacing from "title" column with "Single line of text" but with Custom Column Name and "Multiple lines of text" it fails?

Title - Single line of text  
URLLInk - Multiple lines of text 

======================================================

WORKS $item["Title"] = $item["Title"].Replace("72PRD","PRD")

FAILS $item["URLLInk"] = $item["URLLInk"].Replace("72PRD","PRD")

======================================================

THIS IS THE ERROR MESSAGE SENT BACK TO PS:

At D:\ps\ReplaceLinks1.ps1:10 char:27
+ $value = $item["URLLink"] if($value -Contains "72PRD") {
+                           ~~
Unexpected token 'if' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken

======================================================

ENTIRE SCRIPT
Add-PSSnapin "Microsoft.SharePoint.Powershell"
$web =Get-SPWeb "http://dev"
$list= $web.Lists.TryGetList("devlist")
$web.AllowUnsafeUpdates=$true
foreach($item in $list.Items)
{
$item["URLLInk"] = $item["URLLInk"].Replace("72PRD","PRD")
$item.SystemUpdate();
}
#$list.Update();
Write-Host "Updated values in the list items are"
foreach($item in $list.Items)
{
$item["LinkData"]
}


Ofiice 2010 not installing .MSP updates from within the "Updates folder"

$
0
0

Hey Guys

On a device that has all Office updates installed, I am using a Powershell script to extract all installed Office updates to Office 2010 Pro.

This puts all the updates in a "Updates" folder, which I then copy into the "Updates" Deployment folder (as well as a oct msp file )

The customisation msp is working fine.

However for some reason during the install it no  longer seems to install the .msp Office updates...as when I check Windows for updates it is pulling down 30 or so updates?

On a side note a lot of them refer to 2016.... which is not installed?...Skype for business 2016 is though.

The original extracted Office ISO was SP1.. which I then slip streamed in SP2, ( which I put into the updates folder)

The results from the Powershell script.... when copying into the folder, I have tried "Overwriting" existing files as well as "Skipping" existing files.... as well as deleting the original SP2 msp's and just putting in the results from the Powershell. export, still no luck though?

Any help would be appreciated...thanks.

$updates = "{0}\updates" -f $env:temp
if (test-path $updates) { ri $updates -r -fo }; md $updates | out-null
$msi = new-object -comobject windowsinstaller.installer
$msi.patchesex('', '', 4, 1) | %{
  $pkg = $_.patchproperty('LocalPackage')
  $msp = $msi.opendatabase($pkg, 32)
  if ($msi.summaryinformation($pkg).property(7) -match '000-0000000ff1ce}') {
    try {$view = $msp.openview("SELECT `Property`,`Value` FROM MsiPatchMetadata WHERE `Property`='StdPackageName'")} catch { return }
    $view.execute()
    $record = $view.fetch()
    copy-item $pkg ("{0}\{1}" -f $updates, $record.stringdata(2)) -force
  }
}
start $updates

Viewing all 21975 articles
Browse latest View live


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