How to sign a powershell script to be used for distribution

Hi,
I am new to powershell so if I'm missing out on any detail, please let me know.
We have some powershell scripts we send over to the clients to execute. Their powershell enviroment has execution policy set to 'remote signed'
Now I have read multiple blogs for how to sign the powershell script to be used at different execution levels, but my understanding is signing is for my environment only.
http://www.hanselman.com/blog/SigningPowerShellScripts.aspx
http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/17/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-2-of-2.aspx
I'm probably missing out on something obvious and I'll appreciate if someone can explain me how to sign my script so that client can use it in their environment with any execution level set.
Thanks in advance!

Here's a bit more information on the subject:
http://technet.microsoft.com/en-us/library/hh847874.aspx
http://msdn.microsoft.com/en-us/library/ms537361.aspx
You can get code signing certificates from the major vendors.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)

Similar Messages

  • How to change maintenance powershell script via GPO?

    Per suggestion reposted from here: http://social.technet.microsoft.com/Forums/windowsserver/en-US/6eece9d6-a524-48aa-8e64-7554f0ec9b31/how-to-change-maintenance-powershell-script-via-gpo?forum=winserverGP
    Posted at http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/desktop-shortcuts-to-items-on-network-drives/94eddb27-342b-40fc-9ad4-677ff4ee8ebe?page=9&tm=1403700614489 originally.
    There is a very annoying "feature" in Windows 7 called BrokenShortcuts.ps1 which is being called out weekly via maintenance task and if it finds more than 4 "broken" network shortcuts it removes them all. So it means if a user at this
    moment is disconnected from the network he will lose all links to shares, network applications sitting on his desktop. Funny that there was no such script on Vista and i don't see this on Win8. On the post i have attached one user suggested to edit this script
    and change 4 to 500 or whatever high number. That's fine for one time fix. But i need to do this for 200+ users. This file cannot be simply replaced by a script, so i'm wondering is there any way to do it via GPO?
    I have already tried various startup scripts, but i'm not sure which user to put into commands.
    I need to run this on startup:
    takeown /F C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1
    icacls c:\windows\diagnostics\scheduled\maintenance\TS_BrokenShortcuts.ps1 /grant "some user":F
    copy \\share\folder$\TS_BrokenShortcuts.ps1 C:\Windows\diagnostics\scheduled\Maintenance\ /Y

    You need to take time to study how Windows does these things.  You can control them with GP which is what you asked.  The article shows you how to disable elements of the tasks.  Each task controls a script.  If you disable the task the
    script that deletes shortcuts will be stopped. Other maintenance tasks will continue to run.
    Most of your problem is that you seem to want someone to provide a magical solution.  In technology it is necessary to fully research your issues until you understand all aspects.  After fully studying the issue you should understand the possible
    solutions if they exist.
    You claim to have deployed the patch that Microsoft released to fix the issue.  You claim it didn't work.  If that is the case then you need to call MS and \p[en a support incident.  If  Microsoft determines that you are right about the
    patch not working you will not be charged for the call.
    I know that learning how to support technology is hard and frustrating for newcomers.  In time, by using these incidents to learn, you will become a seasoned technician and all of this will seem trivial.  Until then we can only suggest that you
    do things that most of us are familiar with.  We cannot fix your network for you.
    I think you haven't really posted in the GP forum but posted a question about GP in the server forum.  Try posting in the GP forum.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    Here is one answer from the GP forum:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/600ca14f-8b1b-400c-b27f-a7f5733407ac/windows-scheduled-maintenance-task?forum=winserverGP
    ¯\_(ツ)_/¯

  • How to track the history of supplier sites used for tax reporting (1099)

    Hi,
    Oracle financials doesn't allow two supplier sites setup as tax reportable sites (Unless one is inactive). Suppose if the supplier uses site1 for the year 2009 and site 2 for 2010 and now there is site3 setup as tax reportable. All three sites were setup in 2009 and all three sites are active. Supplier chosen different sites for each year as their tax reportable site.
    How do we know which site oracle used to send 1099 for 2009 & 2010? How to track the history of supplier sites used for tax reporting (1099) in previous years?
    Thanks in advance.
    Regards,
    Ram

    Would the begin_date, end_date and status columns on HZ_PARTY_SITES_USES be any good? Our R12 installations is too new to have accumulated much data yet, but I would look in those columns first.

  • How to find function module's and tables used for the particulat screen or TCODE?

    Hello Nation,
    I would like to know how to find the  function modules and tables used for the particular screen or TCODE or program.
    Example : I would like know the function module used in the program RDBGFT?
                     How can i find that?
    Thanks in advance ,Awaiting your reply.

    Make use of Find function  with the keyword "CALL FUNCTION".
    Make use of the same find function with the keyword "Select" to know the database tables used.
    Regards,
    Philip.

  • I must purchase a photo editing tool and don't know if I should go with Photoshop or Lightroom. I need to learn how to do basic photo editing on pictures used for a news website. Thoughts? Thanks!

    I must purchase a photo editing tool and don't know if I should go with Photoshop or Lightroom. I need to learn how to do basic photo editing on pictures used for a news website. Thoughts? Thanks!

    Hi scienceiscool,
    You can go ahead with the photography plan as mentioned in the link below:
    https://creative.adobe.com/plans/photography?promoid=KLXML
    Kindly refer to the link below to get used to the application better:
    Photoshop CC tutorials from novice to expert
    Regards,
    Sheena K

  • There is any Scripting languages is used for mobile application development

    Is there is any Scripting languages is used for mobile application development?
    For example java script,vb script is used for web development.Like that is there is any scripting language is used for mobile application development along with J2me.
    Thanks & Regards, Sivakumar.J

    806437 wrote:
    .. is there is any scripting language is used for mobile application development along with J2me.If you are talking about javax.script,
    google ( [url http://www.google.com/search?q=java+me+javax.script]java me javax.script ) gave me http://sourceforge.net/projects/rhinoj2mecldc/

  • Signing a powershell script

    Hello,
    I am new to powershell so please be kind :) I have a .ps1 that I want to run on a Windows 2008 web server. It runs fine when I set execution policy to Unrestricted but I do not want to do that. I guess what I want to do is sign the .ps1 script with a cert.
    I have created a self signed cert that is used with a CDN. Can I use that cert? If so how do I sign the .ps1 script with that cert (is that the correct terminology)? I saw many a pages that describe using the makecert command but that is not found on my server.
     Isn't there any easier way to do this?
    Any help is appreciated. Thanks
    Joe

    I was hoping to not have to install a large package on my production web server just to get the commands to create the cert and sign the script. Thanks for the link, however we have a Windows 2008 server and that page is for 2012 server. I am able to create
    a self-signed cert in IIS but I am not sure how to sign a script with it. 
    Thanks.
    Joe

  • How to combine 3 PowerShell scripts to write results to CSV file?

    Hello,
    I have 3 domains, and I like to combine the results from the Get-ADUser and write the results into one CSV file.  Can this be done?  How to do this?  Below are the 3 Get-ADUser
    scripts:
    Get-ADUser -Filter {enabled -eq "true" -and title -like "*"} -SearchBase "DC=domain1, DC=com" -Properties hiredate, department, surname, displayname  export-csv "d:\scripts\pbtfusers.csv"
    Get-ADUser -Filter {enabled -eq "true" -and title -like "*"} -SearchBase "DC=domain2, DC=com" -Properties hiredate, department, surname, displayname  export-csv
    "d:\scripts\pbtfusers.csv"
    Get-ADUser -Filter {enabled -eq "true" -and title -like "*"} -SearchBase "DC=domain3, DC=com" -Properties hiredate, department, surname, displayname  export-csv
    "d:\scripts\pbtfusers.csv"
    Paul

    Sure:
    Get-ADUser tester1 | Export-Csv .\userOutput.csv
    Get-ADUser tester2 | Export-Csv .\userOutput.csv -Append
    Get-ADUser tester3 | Export-Csv .\userOutput.csv -Append
    Sample output:
    PS C:\Scripts\PowerShell Scripts\Misc Testing\9-3-2014> Import-Csv .\userOutput.csv | Select Name
    Name
    tester1
    tester2
    tester3
    This is an extremely simplified example. It returns three user objects and writes them all to the output file one at a time.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • What script would I use for a timesheet using 12:00 am?

    I have been able to add a document level script using Acrobat Pro to show midnight as 12:00 am. But my calculations still don't work. As I have it scripted right now a start time of 12:00 am and an end time of 1:00 am equals -11.00 hours not 1.00 hour. What script would I have to add so the calculation is correct?
    Here is the script I have right now:
    // start time
    // Start time field name
    var cStartName = "start1mon1";
    // Start time format:
    var cStartFormat = "HH:MM";
    // end time
    // end time field name
    var cEndName = "end1mon1";
    // End time format:
    var cEndFormat = "HH:MM";
    // some conversion functions
    // function to convert time string to minutes
    function Time2Num(cTime, cFormat) {
    // convert time string to minutes
    // convert time string to date object
    var oDate = util.scand("mm/dd/yyyy " + cFormat, "01/01/1970 " + cTime);
    // convert date object to number of milliseconds
    var nTime = oDate.getTime();
    // convert milliseconds to minutes and return value
    return Math.round(nTime / (1000 * 60));
    } // end Time2Num function
    function Num2Time(nMinutes) {
    // convert time string to Hours and Minute
    // hours in nMinues
    var nHrs = Math.floor(nMinutes / 60);
    // remainder minutes from hours in nMinutes
    var nMins = nMinutes / 60;
    // return formatted time string
    return nHrs, nMins;
    } // end Num2Time
    // end conversion functions
    // perform the calculation using the fields:
    // get the values of the fields
    var cStartTime = this.getField(cStartName).value;
    var cEndTime = this.getField(cEndName).value;
    // clear the value
    event.value = "";
    // test for not null time strings
    if(cStartTime != "" && cEndTime != "") {
    // compute the time difference in minutes
    nDiff = Time2Num(cEndTime, cEndFormat) - Time2Num(cStartTime, cStartFormat);
    event.value = Num2Time(nDiff);
    } //end not null values
    I have no prior knowledge of JavaScript, only what I have found here on the forums and a lot of luck. I would appreciate help on this problem. Thanks!

    Thank you Gilad D, that worked making a hidden field and just creating the subtraction for the break with that field!   But for future reference if anyone else comes across this question, this is what I used for the time without subtracting the break.
    // Get first field value
    var v1 = getField("Finish Time 1").value;
    //Split field value
    var time1 = v1.split(":");
    // Get second field value
    var v2 = getField("Start Time 1").value;
    //Split field value
    var time2 = v2.split(":");
    var min1 = time1[0]*60 + time1[1]*1 //
    var min2 = time2[0]*60 + time2[1]*1 ;
    event.value = ((min1 - min2) / 60) ;
    If anyone know how to add a break into this script, have at it! But creating a hidden field with the answer of the above script and then creating another box that takes that number minus a break worked good.

  • How to find out what are the interfaces used for Job and Job Codes

    HI All,
    I just wanted to know how do we find out what are the interfaces used for Job and Job codes .
    Thanks In Advance
    Sunny

    Hi,
    Here is an idea for your request.
    Basically you can create a simple query on multiprovider 0TCT_MC01.
    Filter: you can use a variable for restriction of time ( calday, or calmonth) since you should be interested for a time period.
    Choose following characters into your objects:
    InfoProvider ( 0TCTIFPROV )  - you can create a variable for choosing infoprovider before query runs.
    *Tp.[Type of BI Application Object] 0TCTBISOTYP  = filter this with 'QUERY' or whatever your need is.
    *BI Application Object 0TCTBISBOBJ,  ( this will give you the name of the queries)
    In key figures choose,  Count for BI Appl. (0TCTWTCOUNT).
    (number for query run)
    Create a condition , for top 20.
    Hope this helps.
    Derya

  • HT5878 how to check the detail of font being used for reading the file received by an email

    I received word file as an attachment with email on my iphone. I want to check the detail on font being used for reading the word file received as attachment in an email.
    Thanks

    You don't need to copy the cert out of your configuration. OpenSSL has an "s_client" subcommand which can open an SSL connection and verify the cert for you. It even knows how to do STARTTLS. Something like this ought to do it:
    openssl s_client -starttls smtp -CAfile /path/to/ca/file -connect your.ironport:25
    The /path/to/ca/file is necessary to provide openssl with a cache of root CA certs. You could use -CApath instead of -CAfile if you have a hashed directory of root CA certs instead of a single file containing them all.
    You can also point this at your partner's SMTP server as well.

  • EBS 11i how to check if JRE or JInitiator is used for Forms.

    How can I find out in EBS 11i whether application has been configured to use JRE or JInitiator when using Oracle Forms on Client's Desktop?
    Thanks,
    Gulam.

    959674 wrote:
    Hi Hussein,
    I have reviewed both the documents and both documents have mentioned how to find out details about JRE/JInitiator using the Java Console on Clients Windows PC.
    Is there any way to check it on the server side?
    Any configuration file on the server side which will give me this details?Yes. Search the application context file for:
    s_sun_plugin_ver
    s_sun_plugin_type
    s_sun_clsid
    s_jinit_ver_dot
    s_jinit_ver_comma
    s_jinit_clsid
    R11i / R12: Component Version In Oracle Applications [ID 1327288.1]
    Oracle EBS R12 Context Variables [ID 458282.1]
    Thanks,
    Hussein

  • How to know which Smart-Form is being used for Purchase Order print output

    Hi Gurus ,
    How to find which Smart-Form and and methods/program being used for Purchase Order print output in SRM  ?
    In ECC we have tcode NACE where we can check all the details.Is there something similar in SRM ?
    Please help.
    Regards,
    Saurav

    There is no similar transaction in SRM for your purpose. Usually if the customers customize the smartforms, they would choose to use their own form by implementing BADI BBP_OUTPUT_CHANGE_SF. Take a look into your system and see if this BADI is implemented. If so, debug it (by pressing "Print Preview" for a PO for example) and find out what form it is using. Or, if the BADI is not implemented, by default, the system uses form BBP_PO.

  • How to set FileSystemWatcher powershell script to exclude folders within the root path being monitored?

    All,
    I want to use a pre-fab script to monitor the OS folders on a Windows 2008 R2 Domain Controller and send any changes into the Event Log.  But there are two folders in the file path I want to exclude because changes to them would fill up the Event Logs
    too quickly.  Thus, I want to monitor all folder in C:\Windows but want to exclude C:\Windows\Temp and C:\Windows\debug.
    The script I want to use is below.
    #This script uses the .NET FileSystemWatcher class to monitor file events in folder(s).
    #The advantage of this method over using WMI eventing is that this can monitor sub-folders.
    #The -Action parameter can contain any valid Powershell commands. 
    I have just included two for example.
    #The script can be set to a wildcard filter, and IncludeSubdirectories can be changed to $true.
    #You need not subscribe to all three types of event.  All three are shown for example.
    # Version 1.1
    $folder = 'C:\Windows' # Enter the root path you want to monitor.
    $filter = '*.*'  # You can enter a wildcard filter here.
    # In the following line, you can change 'IncludeSubdirectories to $true if required.                          
    $fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $true;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}
    # Here, all three events are registerd.  You need only subscribe to events that you need:
    Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore green
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"}
    Register-ObjectEvent $fsw Deleted -SourceIdentifier FileDeleted -Action {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore red
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"}
    Register-ObjectEvent $fsw Changed -SourceIdentifier FileChanged -Action {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore white
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"}
    # To stop the monitoring, run the following commands:
    # Unregister-Event FileDeleted
    # Unregister-Event FileCreated
    # Unregister-Event FileChanged
    Is there a command line I can use to exclude thos two folders?
    Thanks

    First, thank you to everyone who has been helping me.  I've gotten a little bit further in what I need to do.  I still have two problems that I really need help in sorting out:
    1. The script will run on Windows 7 with no errors but will not run on a Server 2008 R2 Domain Controller.  On the DC, I get an error for the SourceIdentifier:  "A parameter cannot be found that mataches parameter name 'SourceIdentifier'."
    2. Even though the script runs on Windows 7 with no errors, I tested it by making changes to the Temp and debug folders and the changes were still being recorded in the logs.
    A copy of the updated script I am running is below:
    #This script uses the .NET FileSystemWatcher class to monitor file events in folder(s).
    #The advantage of this method over using WMI eventing is that this can monitor sub-folders.
    #The -Action parameter can contain any valid Powershell commands.  I have just included two for example.
    #The script can be set to a wildcard filter, and IncludeSubdirectories can be changed to $true.
    #You need not subscribe to all three types of event.  All three are shown for example.
    # Version 1.1
    $folder = 'C:\Windows' # Enter the root path you want to monitor.
    $filter = '*.*'  # You can enter a wildcard filter here.
    # In the following line, you can change 'IncludeSubdirectories to $true if required.                          
    $fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $true;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}
    # Here, all three events are registerd.  You need only subscribe to events that you need:
    $Script:excludedItems = 'C:\Windows\Temp','C:\Windows\debug'
    Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action {
    If ($excludedItems -notcontains $Event.SourceEventArgs.Name) {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore green
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"} }
    Register-ObjectEvent $fsw Deleted -SourceIdentifier FileDeleted -Action {
    If ($excludedItems -notcontains $Event.SourceEventArgs.Name) {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore red
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"} }
    Register-ObjectEvent $fsw Changed -SourceIdentifier FileChanged -Action {
    If ($excludedItems -notcontains $Event.SourceEventArgs.Name) {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore white
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"} }
    # To stop the monitoring, run the following commands:
    # Unregister-Event FileDeleted
    # Unregister-Event FileCreated
    # Unregister-Event FileChanged
    Thanks in advance for any help you can give.

  • Run powershell script against exchange using task schedule

    I want to run this using task scheduler
    Get-MailboxStatistics -Server mailserver  | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-CSV "\\pacetoputreport\report_$((Get-Date).ToString('MM-dd-yyyy')).csv"
    I know I have to run some variation of this to launch the exchange module
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto"
    How can I do this in Task Scheduler? I have tried numerous times using various combinations, but nothing seems to work.
    Thank you

    You need to put the first part where you call powershell.exe in the Program/script part of the task, but the rest of it is put into the arguments section. As explained here
    http://www.msexchange.org/kbase/ExchangeServerTips/ExchangeServer2013/Powershell/scheduling-exchange-powershell-task.html (which has versions for both 2010 and 2013, but since you list V14 in your filepath I assume you're using 2010) you'd need to
    set the arguments to :
    -version 2.0 -NonInteractive -WindowStyle Hidden -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; <Your Command>"

Maybe you are looking for

  • How to show all the levels of managed metadata in Current navigation in SP 2013

    I am trying to use Managed metadata navigation as Current navigation/Left navigation Bar in a SharePoint intranet publishing site. I found one problem when I was configuring it: If we have the terms in the term set defined as follows: ├─> Root1 │    

  • Composer needs the movie of the score to be larger for viewing purposes

    I have the ability to render my compositions as videos ... for possible upload to internet. The problem is that even in 1080 quality ... the video is too small to see the score clearly as it scrolls across the screen. How can I enlarge the format? Hu

  • Conference Summary Report vs Conference Activity Reports - Different values

    Hi Guys, I have been struggling to understand why the difference in the total conferences displayed on Conference summary reports and Conference activity reports. First, I taught conference summary reports was reporting both success and failed confer

  • Terms and conditions for plugin for B2B?

    Hello Community, we are developing a commercial plugin for Adobe InDesign for B2B. For this purpose we need some information about how to write terms and conditions for Adobe InDesign plugins. Which requirements should we write in the terms and condi

  • Is it possible to lock a certain area from paging?

    In my folios I have an area on the very top where web content is embedded. In this web content there is also a progress knob that you can move from the left to the right and conversely. If you don't touch this knob exactly, the folio moves a bit to t