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

Simple windows form with a combobox and radio

$
0
0

Hi,

Sorry, but i'm newbie in PS and my english so bad(

I try create a simple windows form with a combobox and radio for easy select credentials and connect to MS online services.

It must import from csv Username and pass, after it i'm select param(from radio) to connect, username(from combobox) and after click button must be running powershell console.

Sorry for my bad english(

CSV file like:

Username,Password
user1@test.onmicrosoft.com,13456
user2@1111.onmicrosoft.com,654321

Script:

Add-Type -assembly System.Windows.Forms

$main_form = New-Object System.Windows.Forms.Form
$main_form.Text ='Connect'
$main_form.Width = 100
$main_form.Height = 100
$main_form.AutoSize = $true
$main_form.TopMost = $true

$Label = New-Object System.Windows.Forms.Label
$Label.Text = "Select service:"
$Label.Location  = New-Object System.Drawing.Point(10,10)
$Label.AutoSize = $true
$main_form.Controls.Add($Label)

$RadioButton = New-Object System.Windows.Forms.RadioButton
$RadioButton.Location  = New-Object System.Drawing.Point(10,30)
$RadioButton.Text = 'MSO'
$RadioButton.AutoSize = $true
$main_form.Controls.Add($RadioButton)

$RadioButton1 = New-Object System.Windows.Forms.RadioButton
$RadioButton1.Location  = New-Object System.Drawing.Point(10,50)
$RadioButton1.Text = 'Azure'
$RadioButton1.AutoSize = $true
$main_form.Controls.Add($RadioButton1)

$ComboBox = New-Object System.Windows.Forms.ComboBox
$ComboBox.DropDownStyle = [System.Windows.Forms.ComboBoxStyle]::DropDownList

$ComboBox.DataSource = @{}
import-csv C:\Users.csv -delimiter "," | ForEach-Object {
    $ComboBox.Items.Add($_.username)
    $ComboBox.DataSource.Add($_.username,$_.pass)
}

$ComboBox.Location  = New-Object System.Drawing.Point(10,80)
$ComboBox.Width = 200
$main_form.Controls.Add($ComboBox)

$button = New-Object System.Windows.Forms.Button
$button.Text = 'Connect'
$button.Location = New-Object System.Drawing.Point(70,120)
$main_form.Controls.Add($button)

$button.Add_Click({
$x = import-csv C:\azure\moduls\Login\cred\Users.csv -delimiter "," | ? { $_.username -eq $combobox.Text } | Select -first 1
$sel = $ComboBox.SelectedItem.ToString(); $main_form.Close()
})
$main_form.ShowDialog()


Find DNS record where Frw record is present but reverse does not exits

$
0
0

Hello

Sometime we create forward record, but the revere does not exist

Or IP is given to server , pings, but the forward or reverse is not added in dns

or someone did not clean up dns, so frw removed, but reverse still exits.

Or

Forwrd & reverse do not match.

Is it possible in powercli to find out such discrepancies

thanks

DNS record extraction

$
0
0

Hi

I am looking for script

Input will be subents

10.10.10.0/23 say

O/p

10.10.10.1 - FQDN - Ping (yes/NO)

Thanks

Note : below is not sufficient as you can guess

Get-DnsServerResourceRecord -ZoneName $ForwardLookupZone   -ComputerName $DnsServer |  Export-csv -path C:\temp\xyz.csv

Get-ChildItem parameter -include not working

$
0
0

Hi,

I am looking for a solution to parse a variable as input for the command "Get-ChildItem" - include option. First of all the purpose of the function. I need a function to dynamic scan a folder where the filter, what to process, is the file name extention.

I use the Get-ChildItem. To get only the files with the extention i need the -include property contains one or more file extentions (example -include "*.exe", "*.dll". It works fine in the following case:

$directory = "y:\"
Get-ChildItem $directory -Recurse -Include "*.exe", "*.dll"

Next thing is to build a function to make the static filter dynamic. The script looks like:    

 param (
    [string]$dbserver = "localhost",
    #[Parameter(Mandatory=$true)][string]$voorbeeld,
    [string]$directory = $( Read-Host "Input folder to scan"), 
    [string]$extentions = '"*.dll", "*.txt"'
 )

function getdeployinfo()
{
    param(
        [Parameter(Mandatory=$true)][string]$Path,
        [Parameter(Mandatory=$true)][string]$filter        
    )
    Write-Debug $extentions
    Write-Debug $filter

    foreach ($item in Get-ChildItem $directory -Recurse -Include $filter)
    {
    Write-Host $item.Name
    }
}

Write-Debug $extentions
getdeployinfo -path $directory -filter ([string]$extentions)

The result for the debug is:

DEBUG: "*.dll", "*.txt"
DEBUG: "*.dll", "*.txt"
DEBUG: "*.dll", "*.txt"

There are no items found. I looks like the -include will not accept a variable. When i change "-Include $filter" to -include "*.dll", "*.txt" i get results. 

What's wrong with my script code?

Need help in tweaking the Powershell AD query to find inactive computers

$
0
0

Hello All,

I am a beginner in powershell. i managed to construct a query to find out the inactive computers with last logon name. but the problem is that query time out everytime. if i limit the scope to an OU with less no of systems, then we get to see the results. (eg; from 10k machines to 3k machines)....

is there any way to fine tune this query so that i can run it against all machines in AD .. say around 80k....

import-module Activedirectory
$DaysInactive = 60
$time = (Get-Date).Adddays(-($DaysInactive))
Get-ADComputer -SearchBase "ou=a,DC=x,DC=y,DC=z"  -Filter {(lastLogonTimestamp -lt $time) -and (operatingsystem -notlike '*server*') -and (operatingsystem -notlike "*embedded*")  } -Properties LastLogonDate,operatingsystem | select Name,LastLogonDate,operatingsystem,distinguishedname



JG

Updating an ADUser's Manager with a Contact Card

$
0
0

Hi All

I am trying to update AD User Accounts with Managers created on contact cards. I am having a problem where I cant seem to be able to use contact type instead of User. In AD&C it allows me to change the object type to include contacts. But I cant see how to do it in powershell.

This is the error code im getting

set-aduser : Identity info provided in the extended attribute: 'Manager' could not be resolved. Reason: 'Cannot find an object with identity: 'CN=Joe Bloggs,CN=Users,DC=domain,DC=net' under: 'DC=domain,DC=net'.'.

At line:1 char:1

+ set-aduser -Identity ADGroup1 -Manager "CN=Joe Bloggs,CN=Users,DC=computer ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidData: (DGroup1:ADUser) [Set-ADUser], ADIdentityResolutionException

    + FullyQualifiedErrorId : ActiveDirectoryCmdlet:Microsoft.ActiveDirectory.Management.ADIdentityResolutionException,Microsoft.ActiveDirectory.Management.Commands.SetADUser

I dont have much so far as im stuck. Please help

Get-ADObject-LDAPFilter“objectClass=Contact”

set-aduser-Identity$ADUser.name-Manager$row.managerdistinguishedname-Description$row.description

this is the contents of $row

Group Name          Owner          managerdistinguishedname                                      description

ADGROUP1           Joe Bloggs     CN=Joe Bloggs,CN=Users,DC=Domain,DC=net          Testing



How to package and zip multiple files with different extensions.

$
0
0

We need  to Package and zip the following files under the  "C:\Source\" and name the package “C:\Destination\MONTHLY_YYYYMM.zip where YYYYMM is System YYYYMM -1. Example: In May 2014 it will be Apr 2014 and on Jan 2015 it will be Dec 2015. This will become a scheduled nightly task on a few of our servers.  I don't even know where to start.....



1.test.txt
2.test1.jpg
3.test.bak
4.test.xls

Can anyone help me on this?

How to package and zip multiple files with different extensions on every quarter

$
0
0

How to Package and zip the following files under the "C:\Source\" when the MM – 1 = 03 or 06 or 09 or 11 or 12 (When MM = 01,  01 - 1 <> 0, but 12) and name the package “C:\Destination\MONTHLY_YYYYMM.zip

a.  Test_MONTHLY.txt
b.  All files beginning with the name Test_%.Fil  (WinZip file)
c.  Test_Report_YYYYMM.xls is System YYYYMM -1. Example: In May 2014 it will be Apr 2014 and on Jan 2015 it will be Dec 2015. 



Some Storage CMDLets do not work under WinPE

$
0
0

I have built a custom WinPE based on W2012 and included Powershell and a number of the Powershell CMDLets such as SMB, DISM, and Storage. Everything works fine. When you boot the WinPE disk and do a get-command -module Storage, it shows all of the Storage CMDlets. I am trying to do some simple automation and wrote a very simple script to initialize, partiion and format a disk

Initialize-disk 1 -PartitionStyle MBR
New-Partition  -diskNumber 1 -DriveLetter L -UseMaximumSize | `
  Format-Volume -FileSystem NTFS -NewFileSystemLabel "Stuff"

When I run this script on a W2012 server it works fine. When I run it from by WinPE disk the Format does not work. No error messages. Nothing. The first 2 statments work but the disk never is formatted and no label is assigned. The same is true with the Clear-Disk Cmdlet. I execute it under W2012 and it works fine. When I execute it under Win-PE it just returns to me and does nothing. I even tried just executing the Format-Volume Cmdlet by itself on WinPE and got the same result -- it immediately came back with no error message and did nothing.

It seems like some cmdlets work and some don't. Anyone have any thoughts?

Thanks

Roger


Roger

Command Completion when using Powershell Direct

$
0
0

Hello,

is there a way to enable command completion when connecting remotely to a VM via PowerShell Direct?

I'm using Windows Server 2016 TP5.

Thanks

Christian

Update Calendars

$
0
0

Does anyone know of a way to update Outlook Calendars and Shared Calendars using Powershell? The issue I have is that we are using Cached Mode and only have a certain number of Live Mode connections available. The shared calendars don't update in a timely manner so some have been complaining. I'm trying to figure out a way to code a refresh interval to fetch and update the calendars in the background. The calendars all update correctly when you run the Send and Receive All button, so is there method for this that I can incorporate? We are on Office 2016. I've tried using the code below, but it doesn't seem to do anything. Even setting the show progress bar to true, nothing happens. I've delved deeper in to the properties and have tried pulling my inbox and running the s&r command on that store and session as well with no luck. Any help, or is this a no go? Thanks in advance!

$o = New-Object -ComObject Outlook.Application
$mapi = $o.GetNamespace("MAPI")
$mapi.SendAndReceive($true)


PowerShell Gurus! Where are you!?

$
0
0

Behold! It's the June TechNet Guru Contest!

Your chance to get your name known, raise your profile, get credit where credit is due!

Yes my friends, this is your chance to get listed along-side some of the industry's greatest community heroes!

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

Winning this award in your favoured technology will help us learn the active members in each community.

June's articles are with the judges, but below are the previous month's mighty winners and contenders!

Guru Award BizTalk Technical Guru – April 2016 
Gold Award WinnerEldert GrootenboerUsing BizTalk Deployment Framework with MSBuild to bypass reserved placeholdersJS: “BTDF if getting quite popular. Nice to see some advanced use cases.”
LG: “Good practical tip. Thank you sharing!”
Sandro Pereira: “Well written, excellent article for BTDF lovers”
Silver Award WinnerSMSVikasKIntegration Between Microsoft BizTalk Server 2013 & Microsoft Dynamics CRM Online 2016LG: “BizTalk Dynamic CRM is a very hot topic.”
JS: “Microsoft CRM’s API is very (maybe too :)flexible, this is a simple and expandable pattern to start a BizTalk integration app with. “
Bronze Award WinnerSandro PereiraBizTalk Server DevOps: Configuring Receive and Send Handlers in BizTalk Ports with PowerShellJS: “Great addition to BizTal’s PowerShell story. Super useful for VM provisioning and similar cases.”
LG: “Thank you sharing!”

Guru Award Forefront Identity Manager Technical Guru – April 2016 
Gold Award WinnerJeff IngallsManaging Contacts in the FIM/MIM PortalPG: “Wow, nice! Keep up the good work!”
Søren Granfeldt: “Good and detailed walk-through”

Guru Award Microsoft Azure Technical Guru – April 2016 
Gold Award WinnerSandro PereiraAzure Logic Apps: Dynamic Hello World using Azure Functions inside Logic AppsJH: “Good articles from Sandro this month. This one is a good entry into Azure Functions.”
AN:“Very good”
Silver Award WinnerBhushan GawaleAzure Remote Apps – In Depth WalkthroughJH: “Nice Azure Remote Apps walkthrough with a good mixture of text and pictures.”
AN: “Great walkthrough!”
Bronze Award WinnerJanshair KhanUnderstanding and Creating Azure Deployment SlotsJH: “Short overview about deployment slots. A little bit more on their usage would be great.”
AN:“Another great article!”

Guru Award Miscellaneous Technical Guru – April 2016 
Gold Award WinnerNamrah KhurramGetting started with the Raspberry Pi – A walk-throughRichard Mueller: “Great images and good explanation”
Silver Award WinnerSYED SHANUDraw MVC Pie Chart using WEB API, AngularJS and JQueryRichard Mueller: “More good images and code.”
Bronze Award WinnerJanshair KhanUnderstanding Docker for Absolute BeginnersRichard Mueller: “A great tutorial to explain what it is.”

Guru Award SharePoint 2010 / 2013 Technical Guru – April 2016 
Gold Award WinnerNathanaël StassartSharePoint 2013 – Crawl file shares beyond the 260 MAX_PATH limit – Issue with ErrorID 808 829 – The object is not foundTN: “This article is extremely helpful providing real-world experience when working with fileshare”
Silver Award WinnerWaqas SarwarSharePoint 2016 Rename Site Collection URL Best PracticeTN: “Great article in SharePoint 2016 which is very new to the community.”
Bronze Award WinnerNathanaël StassartSharePoint 2016 – Crawl Error List [ErrorID]TN: “Thanks Nat”

Guru Award Small Basic Technical Guru – April 2016 
Gold Award WinnerNonki TakahashiSmall Basic: FlickrMichiel Van Hoorn: “Nice to see updated doc”
DEVA: “Great one Nonki. You rock onemore time…!!”

Guru Award SQL BI and Power BI Technical Guru – April 2016 
Gold Award WinnerGreg Deckler (Fusion Alliance)Power Query: Using Recursion to Solve Hex to Decimal ConversionPT: “A very good wiki contribution. Thank you! This post is deep and specific to solve a particular challenging issue.”

Guru Award Transact-SQL Technical Guru – April 2016 
Gold Award WinnerNatig GurbanovSql Server: Using Parameterized FunctionsJS: “”
Richard Mueller: “Interesting code. Grammar needs work.”

Guru Award Universal Windows Apps Technical Guru – April 2016 
Gold Award WinnerRavindra Singh ChhabraHow to install native Service into Windows 10 mobileRC: “Great work”
Silver Award WinnerManisha BiswasMicrosoft Hololens a walkthroughRC: “Very nice”
Bronze Award WinnerRavindra Singh ChhabraLocalization for Windows Universal AppsRC: “Another good one”

Guru Award Visual Basic Technical Guru – April 2016 
Gold Award WinnerEmiliano MussoCreate a versioning service with Visual Basic .NETCarmelo La Monica: “Congrats Emiliano, very goos article, image and video. Good work.”
MR: “Good walkthrough!”
Richard Mueller: “Very well explained. Great images.”
Silver Award Winner.paul.Vb.Net – Animations and MoviesRichard Mueller: “Well written and an interesting topic.”
MR: “Great little utility!”
Carmelo La Monica: “Great, very useful for to create animation with images. Congrats!”

Guru Award Visual C# Technical Guru – April 2016 
Gold Award WinnerSibeesh VenuHow To Create Dynamic Angular JS Tabs In MVCJaliya Udagedara: “Great article with a step by step explanation. Love the fact that it’s using Angular Material. Hint: You can upload the sample code to MSDN Code Gallery. “
Silver Award WinnerSYED SHANUC# Winform Animated Image Slide Show in WinformJaliya Udagedara: “Good article with images and code snippets. And the sample code is available for download from MSDN Code Gallery.”
Bronze Award WinnerSibeesh VenuProgrammatically Extract or Unzip Zip,Rar Files And CheckJaliya Udagedara: “Good article explaining the whole process including file upload and file extraction. You can always use MSDN Code Gallery to upload the source code, so anyone can view/download from there.”

Guru Award Windows PowerShell Technical Guru – April 2016 
Gold Award WinnerVZSandzWindows MAK activation with PowerShellJan Egil Ring: “Nice start, needs a polish”
Richard Mueller: “Good code to know about. Grammar needs work.”

Guru Award Windows Presentation Foundation (WPF) Technical Guru – April 2016 
Gold Award WinnerAndy ONeillHide The Visual Studio 2015 Update 2 In App MenuLL: “Thanks for the top Andy”
Peter Laker:“Thanks Andy”

Guru Award Windows Server Technical Guru – April 2016 
Gold Award WinnerNathanaël StassartAD FS 4.0: Discover, Setup and Publish Application: Part1Mark Parris: “Good Information on ADFS v4.”
JM: “Your two articles on Web Application Proxy are excellent, thanks for your contribution”
Richard Mueller: “Great code and good images.”
Silver Award WinnerAvendilActive Directory: Transferring and Seizing the RID Master roleRichard Mueller: “Great use of Wiki guidelines, great references and links. Very important information to know. I like the detailed steps and alternative methods. And I love the cross-links. An excellent article.”
Mark Parris: “PowerShell replacing the GUI process, handy to have in Onenote.”
JM: “This is a great article on the RID Master role, thanks for your contribution”
Bronze Award WinnerKia Zhi Tang (Ryen Tang)Nano Server: Deploying PHP 7.0.6 on Internet Information Services (IIS) Web ServerRichard Mueller: “Very good references and lots of good code.”
JM: “This is an excellent article on Nano Server, thanks for contributing”
Mark Parris: “Good Insight.”

Thanks in advance!
Pete Laker


#PEJL
Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over toTechNet Wiki, for future generations to benefit from! You'll never get archived again, and you could win weekly awards!

Have you got what it takes o become this month's TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

cant find file

$
0
0

I'm new to PowerShell and  I'm trying to delete multiple users from O365. I keep getting an error.

I log into PowerShell as admin and enter: Import-Csv c:\userdeletions | ForEach-Object {Remove-MsolUser -UserPrincipalName $_.UserPrincipalName}

I get back the following error:

Import-Csv : Could not find 'C:\userdeletions'. At Line:1 Char:1

String comparison not working when 'Run with Powershell' or as a scheduled task

$
0
0

I've been banging my head against the wall far too long on this, I'm hoping someone can help me spot what's going on.

I have a bit more complex script than what's posted below, but I stripped it down to the bare minimum and can still reproduce the problem on Windows Server 2008 and Windows 7, both x64, both with PS3 installed.

If I copy the code and paste it into a PS console it works fine.  If I call the script from a PS console it works too.  If I right-click the script file and Run with Powershell, or if I run it as a scheduled task, the string comparison fails.  I'm outputting the result to a file so I can easily see and track the results of my testing.  I first thought it was environmental because it was a scheduled task, but now the script is so minimal and the problem exists without the scheduled task or other user, so I'm at a loss to understand why it isn't working.

Here's the code:

$list = @" blah1 blah2"@ -split "`n" $cmd = "`"$($list[-2])`" -eq `"blah1`""

"$cmd`: $(invoke-expression $cmd)" | out-file c:\temp\junk\blah\result4.txt -append

Here's the output of the text file, first with code pasted into the PS console, then right-clicking on the file and select Run with Powershell.  The result is distinctly different:

Thanks in advance for any insight


I hope this post has helped!

read a 64 bit registry key for ISE (x86)

$
0
0
How can you read a 64 bit registry key from ISE(X86)?   It took me a while to figure out until I saw X86 then realized that powershell (X86) is reading the 32 bit registry ( or saying it differently - reads under Wow6432Node registry keys instead of the standard keys)  on my 64 bit system.   My script works if I run it from powershell, not powershell ISE (x86).   Is there a way to read from the 64 bit side using ISE (X86)?

Getting Error while running Get-DscConfiguration in Windows Server 2008 R2

$
0
0

Hi ,

I am trying to run "Get-DscConfiguration -Verbose" in server 2008 R2 in order to upload the output of it Pull Server using POST method. But I am getting following error :

Get-DscConfiguration : Current configuration does not exist. Execute Start-DscConfiguration command 
with -Path parameter to specify a configuration file and create a current configuration first.At 
line:1 char:1
+ Get-DscConfiguration -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_DSCLocalConfigurationManager:root/Microsoft/...gura 
   tionManager) [Get-DscConfiguration], CimException
    + FullyQualifiedErrorId : MI RESULT 1,Get-DscConfiguration

The same works pretty well for 2012 server and I able to upload the same.


Regards,

Sudhakar

Signing Powershell Script Returns and "UnknownError" Status

$
0
0

I am trying to self sign some scripts  but keep getting a status of "UnknownError" after the script completes successfully. The strange part is, the script does complete and sign the certs, it just gives a UnknownError status afterwards.

Could someone please assist?

$cert = Get-ChildItem -Path Cert:\LocalMachine\My\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Set-AuthenticodeSignature C:\scripts\patching-TEST-v2.ps1 -Certificate $cert


SignerCertificate                         Status                                                       Path
-----------------                         ------                                                       ----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  UnknownError                                                 patching-TEST-v2.ps1                                       

Here is how I created the cert:

New-SelfSignedCertificateEx -Subject "CN=Generic Powershell CSC" -EnhancedKeyUsage "Code Signing" -StoreLocation LocalMachine -Exportable

However, when I do a Get-ChildItem on the cert, the EnhancedKeyUsageList does not list anything

PS C:\Windows\system32> Get-ChildItem -Path Cert:\localmachine\my\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | Format-List -Property *


PSPath               : Microsoft.PowerShell.Security\Certificate::localmachine\my\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PSParentPath         : Microsoft.PowerShell.Security\Certificate::localmachine\my
PSChildName          : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PSDrive              : Cert
PSProvider           : Microsoft.PowerShell.Security\Certificate
PSIsContainer        : False
EnhancedKeyUsageList : {}
DnsNameList          : {}
SendAsTrustedIssuer  : False
Archived             : False
Extensions           : {System.Security.Cryptography.Oid, System.Security.Cryptography.Oid, System.Security.Cryptography.Oid}
FriendlyName         :
IssuerName           : System.Security.Cryptography.X509Certificates.X500DistinguishedName
NotAfter             : 5/24/2017 4:16:03 AM
NotBefore            : 5/24/2016 4:16:03 AM
HasPrivateKey        : True
PrivateKey           : System.Security.Cryptography.RSACryptoServiceProvider
PublicKey            : System.Security.Cryptography.X509Certificates.PublicKey
RawData              : {48, 130, 3, 20...}
SerialNumber         : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
SubjectName          : System.Security.Cryptography.X509Certificates.X500DistinguishedName
SignatureAlgorithm   : System.Security.Cryptography.Oid
Thumbprint           : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Version              : 3
Handle               : 641073664
Issuer               : CN=Generic Powershell CSC
Subject              : CN=Generic Powershell CSC


Powewrshell Parse file help

$
0
0
Hey,

So I will explain the overall situation first for better understanding. I have a script running that mirrors two directories and updates a log file about what happens between the two directories. I want to Parse this log file to get updates as they come in (while the script is running) and I want these to send me an email of what has changed, like a notification almost.

I'm unsure on how I would go about doing this after reading through some of the command lists online.

not all that strong with PowerShell so any help would be greatly appreciated, Thanks in advance :)

Edit: I don't want to get notified about the same bit of info more than once if possible.

Please provide Powershell script for setting Datasource reference for Shared data set

$
0
0

Please provide Powershell script for setting Datasource reference for Shared data set.


Srinivasarao G, MCSE(Business Intelligence) Blog:http://sqlcart.blogspot.com

New-JobTrigger -AtStartup really doesnt work..?? :-(

$
0
0

Hi,

i tried this code, it works (at the first look) really good, the jobs are created and the job "WSUSUPdate" with trigger -at runs fantastic... but the job with the trigger, AtStartup works never.... can someone explain me why??

I tried to register ist local on myserver but this doesnt work too.. does anyone have any idea???

$computername = "myserver"
$cred = get-credential
Invoke-Command -ComputerName $computername -credential $cred -ScriptBlock {
$termin = New-JobTrigger –Once –At "June 03, 2016 11:35"
$start = New-JobTrigger -AtStartup
Register-ScheduledJob -Name WSUSUpdate -ScriptBlock { new-item -path "c:\wsus\jobfolder" -type directory -force} -Trigger ($Termin) -ScheduledJobOption (New-ScheduledJobOption -RunElevated)
Register-ScheduledJob -Name WSUSReboot -ScriptBlock { new-item -path "c:\wsus\jobfolder3" -type directory -force} -Trigger ($start) -ScheduledJobOption (New-ScheduledJobOption -RunElevated)
} 

And a scheduled-Task isnt working for me...


Viewing all 21975 articles
Browse latest View live


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