VMM 2012R2 - cannot extract IP using Powershell

Hello everyone,
I have 4 Hyper-V VMs in SCVMM 2012R2, 2 x 2012R2 and 2 x 2008R2, and when I run the following command, I only get an IP back for the 2012 ones.
Get-SCVirtualMachine
"VMname"
|
select
-ExpandProperty
VirtualNetworkAdapters
|
Selectname,IPv4Addresses
Name            IPv4Addresses
2008VM01        {}
2008VM02        {}
2012VM01        {10.20.20.20}
2012VM02        {10.20.20.21}
They are all on the same VM network, which does not have a VMM IP Pool, it has a normal DHCP server, which has got the relevant reservations for all of them, and the IP's are all defined manually within the VM's OS. Indeed, connectivity to/from all of them
over IP is fine.
In VMM they are all set to "dynamic IPaddress" and "static mac address", and none of them were built from a template, all manually created.
So it is all working OK, communications-wise, I just can't expose the IPs for the 2008 ones through Powershell (nor does VMM see it in the "Connection details" tab in VMM), which I need to do for a script I (am trying to!) run..
I do have other 2008 VMs that Powershell can see the IPs of, so it is just these two..
Thoughts appreciated !
David

This was resolved by upgrading the Integration Tools.. they were on ver 6.1.7601.17514, they're now ver  on 6.3.9600.16384
 

Similar Messages

  • How do I bulk upload documents using PowerShell and extract metadata from file name?

    I have a requirement to upload a bunch of documents into a document library. Based on the content type, the rules of updating the metadata is different...the one giving me trouble is to extract the metadata from the file name. If I have a file name like
    "part1_part2_part3.pdf" how do I extract part1, part2, part3 and tag each document being uploaded into SharePoint, using PowerShell? I have searched and have not been able to find anything to get me started.
    Has anyone done this before? Or is there a blog I can take a look at? Thanks
     

    You will have to write a PS script encompassing this logic.
    Read files from the folder using
    Get-Item cmdlet
    Determine the content type based on the path or filename.
    Split the file name to extract the tag names.
    If the metadata fields in the content type is a managed metadata field, check whether the term exists and set it.
    Updating SharePoint Managed Metadata Columns
    with PowerShell
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Cannot Extract Embedded Font in PDF Report Generated Using Crystal Reports XI

    The issue is that sometimes the PDF reports generated by Crystal Report XI are not showing the fonts properly. Arial font is used in the Crystal report template(.rpt file) for field label and data elements. When the report is opened in Adobe Reader, it displays the message - "Cannot extract the embedded font 'AAAAAA+ArialBold'. some characters may not display or print correctly." Other PDF Readers like Foxit show blank spaces instead. I tried to change the font to Courier New, Times New Roman etc but still getting the same message.
    The issue is consistent when the application is deployed in Windows server. When deployed in Unix server the issue happens very occasionally. The font files are available and installed in the UNIX box.
    Please tell me why this error message is shown and also tell me how to get it fixed.

    Hi Scot
    Just replied to your email re. conf call.
    In the meantime.
    1st question.  
        Some of our developers are creating the reports under crystal 2008, while some are 2011.
        Could this be a problem, when they are run by the SDK?
        Should we upgrade all our developers to crystal 2011?
    The version of CR a report is created in should not matter at all. I am 100% certain this is not the issue.
    2nd question
        When the report is run, to create the pdf... why would it actually embed the font on the pdf?
        if they weren't embedded.. wouldn't it just pull up the proper font, if the user's pc had that font on their
        pc?
        if it does the common fonts aren't embedded, we would just have to worry about the things like
        barcode 3 of 9
    I can not answer this as that essentially is the way the product is designed. It may look like a limitation, but there are no work-arounds and I would not consider this to be a bug. Perhaps an enhancement, but a pretty faint hope there. And even if, enhancements take very, very low priority and take long, long time before implementation.
    3rd question
        Would the fonts, just need to be installed on the server?   we've seen some indication, that they
        also need to be in a java sub-directory
    The fonts must be on the server as that is where the report engine does it's work, then the report is streamed to the user's browser. E.g.; there is no work done on the browser. Also, the process must have rights to access the fonts.
    One last point. You mention deployment to Linux. Linux is not supported. Please see: SAP Crystal Reports, Developer Version for Microsoft Visual Studio - Supported Platforms
    I suspect this is more an issue with CR not working with the framework for Linux.
    - Ludek

  • How to extract audit log data from every document library in site collection using powershell?

    Hi All,
    I have n number of document library in one site collection,
    My query is- How to extract audit log data from every document library in a site collection using powershell?
    Please give solution as soon as possible?

    Hi inguru,
    For SharePoint audit log data, These data combine together in site collection. So there is no easy way to extract audit log data for document library.
    As a workaround, you can export the site collection audit log data to a CSV file using PowerShell Command, then you can filter the document library audit log data in Excel.
    More information:
    SharePoint 2007 \ 2010 – PowerShell script to get SharePoint audit information:
    http://sharepointhivehints.wordpress.com/2014/04/30/sharepoint-2007-2010-powershell-script-to-get-sharepoint-audit-information/
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Want to extract the data using powershell script.

    [Jul 21 15:01:47] INFO  (Fixmethod.java:1998) - UNABLE TO CONNECT TO FIX SERVER ATTEMPT NO:3 - logConsoleMsg
    I want to retrieve [Jul 21 15:01:47] from line above  into a variable. using powershell.
    How can it be done.
    Thanks in Advance.

    I tried "a.substring(1,15)", and it is working fine. :)
    Just be aware that it may not always work the way you expect it to. What happens when you only need 14 characters instead of 15?
    [Jul 1 15:01:47] instead of [Jul 21 15:01:47].
    This, of course, assumes that the dates aren't presented like so: [Jul 01 15:01:47]. If that's the case, you can just ignore this post.
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Using powershell to deploy provider-hosted app and specify remote Url instead of using appinv.aspx page

    Hello all,
    Could you possibly help me with provider-hosted app development/deployment process.
    We developed SharePoint provider-hosted app that works just fine in development environment. Now we need to automate it's installation in test environment via powershell.
    In AppManifest.xml that we are deploying we have key instead of explicit URL:
    <App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="ShowAllRoomsApp" ProductID="{922a18aa-5592-b59a-4da9-4791baef02e7}" Version="1.0.0.0"
    SharePointMinVersion="15.0.0.0">
      <Properties>
        <Title>SomeTitle</Title>
        <StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>
    If we use as
    https://technet.microsoft.com/en-us/library/jj655398.aspx recommends, we cannot specify Redirect Url as we can do this on
    /_layouts/appinv.aspx
    So now it seems like the only way to deploy this kind of solution is using appinv.aspx page.Or must we apply this URL in AppManifest on developing stage in Visual Studio?
    What did I miss?
    P. S. Even if I use /_layouts/appinv.aspx after powershell commandlets, I get error.

    hi,
    to deploy provider hosted app you need 2 things
    1. Client ID
    2. Redirect URL.
    What you can do you can generate app from visual studio using clientID and URL from developer enviornment.
    Now a app file is just a simple compressed zip file if you rename it as .zip and extract you will find AppManifest
    inside it. So to create an app for Testing enviornment what you have to to Get the CLient ID (from AppRegNew.aspx) in testing enviornment. Unzip .App file change the AppManifest with testing client ID and URL than again zip file and rename as .app.
    Now if you upload this file it will work.
    To automate this scenerio i have created a simple windows Application in which i Pass the Client ID and StartURl and an App File it unzips the app file make changes to app and again zip it.
    public static class AppPackageHelper
    public const string StartUrlExpression = "{0}?{1}";
    public const string StandardToken = "{StandardTokens}";
    public static string Publish(string appPath, string ClientId,string StartUrl)
    string tempDir = string.Empty;
    string outPutFile = string.Empty;
    try
    string parentDir = System.IO.Path.GetDirectoryName(appPath);
    outPutFile = System.IO.Path.Combine(parentDir, ClientId + "-Winshuttle.app");
    tempDir = System.IO.Path.Combine(parentDir, ClientId.ToString());
    Directory.CreateDirectory(tempDir);
    int lastInd = appPath.LastIndexOf('.');
    string tempPath = string.Empty;
    string targetFilePath = string.Empty;
    string cabPath = System.IO.Path.Combine(tempDir, System.IO.Path.GetFileNameWithoutExtension(appPath) + ".cab");
    FileInfo fInfo = new FileInfo(appPath) { IsReadOnly = false };
    File.Copy(appPath, cabPath);
    XDocument doc = null;
    string appManifest = string.Empty;
    using (ZipArchive zipArch = ZipFile.Open(cabPath, ZipArchiveMode.Update))
    appManifest = string.Format(@"{0}\AppManifest.xml", Directory.GetParent(cabPath).FullName);
    ZipArchiveEntry manifestEntry = zipArch.Entries.LastOrDefault(e => e.Name.ToLower() == "appmanifest.xml");
    manifestEntry.ExtractToFile(appManifest);
    doc = XDocument.Load(appManifest);
    XNamespace ns = doc.Root.GetDefaultNamespace();
    string defaultUrl = string.Format(StartUrlExpression, StartUrl.TrimEnd('/'), StandardToken);
    doc.Descendants(XName.Get("StartPage", ns.NamespaceName)).First().Value = defaultUrl;
    doc.Descendants(XName.Get("RemoteWebApplication", ns.NamespaceName)).First().Attribute(XName.Get("ClientId")).Value = setupInfo.ClientId.ToString();
    doc.Save(appManifest);
    if (manifestEntry != null)
    manifestEntry.Delete();
    zipArch.CreateEntryFromFile(appManifest, "AppManifest.xml");
    int totEnt = zipArch.Entries.Count;
    for (int e = 0; e < totEnt; e++)
    if (zipArch.Entries[e].Open().Length == 0)
    //if (zipArch.Entries.Count > totEnt && e >= totEnt) break;
    //zipArch.CreateEntry(zipArch.Entries[e].FullName);
    File.Delete(appManifest);
    if (File.Exists(outPutFile))
    File.Delete(outPutFile);
    File.Move(cabPath, outPutFile);
    return outPutFile;
    catch
    throw;
    finally
    if (System.IO.Directory.Exists(tempDir))
    System.IO.Directory.Delete(tempDir, true);
    return outPutFile;
    using System.IO.Compression.FileSystem.dll.
    Also if you want to do it using powershell You need to do the same thing unzip-> changes values-> zip
    So basic thing is You need to ahve only valid AppManifest file which contains 2 valid values Client Id and StartUrl
    if you changes it inside appmanifest manuall than it will also work. Using above code you can create a console Application to do it. You can use powershell it just that i dont know how to zip unzip in powershell but i am pretty sure you can easily find it
    on searching.
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Creating a Scheduled Task using PowerShell v4

    So here is my question.  I'm trying/wanting to create a scheduled task using PowerShell v4 on Server 2012R2.  I want to task to run on the 1st day of every month.  The parameter for -Monthly -Day is not available.  I need to use PowerShell
    to create the Scheduled Task because the Task will be running with a group Managed Service Account credentials so the Scheduled Task can not be created via the Task Scheduler GUI.
    Thanks in Advance

    Here is a functioning task It can be easily edited in PowerShell or in notepad to alter the timing
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.1" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <RegistrationInfo>
    <Author>W8TEST\user01</Author>
    </RegistrationInfo>
    <Triggers>
    <CalendarTrigger>
    <StartBoundary>2014-06-04T21:31:32.0459499</StartBoundary>
    <Enabled>true</Enabled>
    <ScheduleByMonth>
    <DaysOfMonth>
    <Day>1</Day>
    <Day>12</Day>
    <Day>24</Day>
    </DaysOfMonth>
    <Months>
    <January />
    <February />
    <March />
    <April />
    <May />
    <June />
    <July />
    <August /
    <September />
    <October />
    <November />
    <December />
    </Months>
    </ScheduleByMonth>
    </CalendarTrigger>
    </Triggers>
    <Principals>
    <Principal id="Author">
    <RunLevel>LeastPrivilege</RunLevel>
    <UserId>W8TEST\jvierra</UserId>
    <LogonType>InteractiveToken</LogonType>
    </Principal>
    </Principals>
    <Settings>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <IdleSettings>
    <StopOnIdleEnd>true</StopOnIdleEnd>
    <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
    </Settings>
    <Actions Context="Author">
    <Exec>
    <Command>notepad.exe</Command>
    <Arguments>test.txt</Arguments>
    <WorkingDirectory>c:\temp</WorkingDirectory>
    </Exec>
    </Actions>
    </Task>
    I have edited and reloaded the XML many, many times.  It works very nicely.
    ¯\_(ツ)_/¯

  • How to add a certificate to IIS global "Server Certificates" list using PowerShell?

    Hi, been surfing the web for an example on how to add a certificate to the "global" IIS "Server Certificates" list using PowerShell but to no luck. I already have code in place on how to tie / associate a specific website with a specific cert but not how
    to add the new .cer file using the "Complete Certificate Request..." wizard using PowerShell.... I dont expect the final code to become published but if someone had an idea on howto integrate / get an entry point on where to interact between the "Server Certificate"
    list in IIS and POSH I would be super happy! :|
    I am runnign IIS on a Windows 2008R2 x64 Standard Edition if that helps..... of course, I would saddle for an CLI if there is no other way, but POSH is of course the way to go! :)
    Thanks for the help in advance guys, take care!
    br4tt3

    Hi and thanks for the suggestions!
    Although it comes close, the suggested code example points on howto import / incorporate .pfx files - I am getting fed by .cer files which I need to add into the IIS console using POSH.
    I tried explore the IIS.CertObj object but was not able to work out if this one could be used for importing / adding .cer files into IIS! However, launching the following command from a POSH console with Import-Module Webadministration already
    loaded into that shell;
    $certMgr = New-Object -ComObject IIS.CertObj returns the following error message:
    New-Object : Cannot load COM type IIS.CertObj
    From an IIS perspective I have the following components installed;
    [X] Web Server (IIS)                                    Web-Server
        [X] Web Server                                      Web-WebServer
            [ ] Common HTTP Features                        Web-Common-Http
                [ ] Static Content                          Web-Static-Content
                [ ] Default Document                        Web-Default-Doc
                [ ] Directory Browsing                      Web-Dir-Browsing
                [ ] HTTP Errors                             Web-Http-Errors
                [ ] HTTP Redirection                        Web-Http-Redirect
                [ ] WebDAV Publishing                       Web-DAV-Publishing
            [X] Application Development                     Web-App-Dev
                [ ] ASP.NET                                
    Web-Asp-Net
                [X] .NET Extensibility                      Web-Net-Ext
                [ ] ASP                                    
    Web-ASP
                [ ] CGI                                    
    Web-CGI
                [ ] ISAPI Extensions                        Web-ISAPI-Ext
                [ ] ISAPI Filters                           Web-ISAPI-Filter
                [ ] Server Side Includes                    Web-Includes
            [ ] Health and Diagnostics                      Web-Health
                [ ] HTTP Logging                            Web-Http-Logging
                [ ] Logging Tools                           Web-Log-Libraries
                [ ] Request Monitor                         Web-Request-Monitor
                [ ] Tracing                                
    Web-Http-Tracing
                [ ] Custom Logging                          Web-Custom-Logging
                [ ] ODBC Logging                            Web-ODBC-Logging
            [X] Security                                   
    Web-Security
                [ ] Basic Authentication                    Web-Basic-Auth
                [ ] Windows Authentication                  Web-Windows-Auth
                [ ] Digest Authentication                   Web-Digest-Auth
                [ ] Client Certificate Mapping Authentic... Web-Client-Auth
                [ ] IIS Client Certificate Mapping Authe... Web-Cert-Auth
                [ ] URL Authorization                       Web-Url-Auth
                [X] Request Filtering                       Web-Filtering
                [ ] IP and Domain Restrictions              Web-IP-Security
            [ ] Performance                                 Web-Performance
                [ ] Static Content Compression              Web-Stat-Compression
                [ ] Dynamic Content Compression             Web-Dyn-Compression
        [X] Management Tools                                Web-Mgmt-Tools
            [X] IIS Management Console                      Web-Mgmt-Console
            [X] IIS Management Scripts and Tools            Web-Scripting-Tools
            [ ] Management Service                          Web-Mgmt-Service
            [ ] IIS 6 Management Compatibility              Web-Mgmt-Compat
                [ ] IIS 6 Metabase Compatibility            Web-Metabase
                [ ] IIS 6 WMI Compatibility                 Web-WMI
                [ ] IIS 6 Scripting Tools                   Web-Lgcy-Scripting
                [ ] IIS 6 Management Console                Web-Lgcy-Mgmt-Console
        [X] FTP Server                                      Web-Ftp-Server
            [X] FTP Service                                 Web-Ftp-Service
            [X] FTP Extensibility                           Web-Ftp-Ext
        [ ] IIS Hostable Web Core                           Web-WHC
    More or less the one thing that I am trying to get up and running is an automated FTPS solution - I just use the IIS console to be able to troubleshoot / compare how things scripted from POSH interacts in the MMC representation. The error I am getting
    might be that I am lacking some IIS components to be in place to be able to automate some parts of the IIS - as suggested by the IIS.CertObj object listed in the example..... I will get back if I can track down which component needs to be added to be
    able to reference the IIS.CertObj object.
    Br4tt3 signing out...
    br4tt3

  • How can I find what scom group a specific server belongs to using powershell?

    Environment:  SCOM 2007 r2
    Server in question:  Running Windows 2003 Std. (yes I know this sounds crazy)
    Why do I need this:  I noticed at the console level we have had server unexpected shutdown events which are not generating email notifications. 
    Source shows: Windows 2003 Server Standard Edition
    Alert Rule:  Windows Shutdown Unexpectedly
    From what I see these are all windows 2003 server Std edition systems.  I did a track and trace using our exchange tracking system which confirmed the alerts were not being emailed. Not sure if there is a better approach for this, but not being a sql
    expert (however I do have someone I can leverage) I am trying to see if I can somehow extract this information using powershell.
    Secondary general question:  How can I find out the current size of our scom 2007 database and the number of objkects\servers being monitored? This is prep work for a migration over to 2012.
    Thanks in advance for the help!

    1. what scom group a specific server belongs to
    function Get-GroupNames {
     [cmdletbinding()]
     param($computerFQDN)
     $containmentRel = Get-RelationshipClass -name:’Microsoft.SystemCenter.InstanceGroupContainsEntities’
    $computerClass = Get-MonitoringClass -name:”Microsoft.Windows.Computer”
    $criteria = [string]::Format(“PrincipalName = ‘{0}’”,$computerFQDN)
     try {
     $computer = Get-MonitoringObject -monitoringClass:$computerClass -criteria:$criteria
     $relatedObjects = $computer.GetMonitoringRelationshipObjectsWhereTarget($containmentRel,[Microsoft.EnterpriseManagement.Configuration.DerivedClassTraversalDepth]::Recursive,[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive)
     catch {
     $_
     write-host “An error occurred while querying groups of $computerFQDN”
    foreach($group in $relatedObjects)
     [array]$Groups = $groups + $group.SourceMonitoringObject.DisplayName
     if($groups) {
     return $groups
     } else {
     write-host “No groups available for $computerFQDN”
    Usage:
     Get-GroupName -ComputerFQDN myserver1
    for detail, pls. refer to
    http://techibee.com/powershell/powershell-get-scom-groups-of-a-computer-account/1129
    Roger

  • How to add multiple users permissions to a calendar using powershell?

    I have an organization that was recently setup in Exchange Online and they have unique circumstances in that every user in the organization needs "reviewer"
    access to every other users calendars.  I cannot change the default permission since new users added after this should not be able to see these calendars details.  There are a few I will go back to run a Set command on to change an individual permission
    here and there for specific needs, but the main need is below.
    I have basic experience with powershell commands and have found how to manually add a single users permissions to a calendar using the command below:
    Add-MailboxFolderPermission -Identity alias:\calendar -user alias -AccessRights reviewer
    Since it's not realistic to run this command thousands of times changing the user aliases each time, I was hoping someone could help me build a command to run on a single mailbox's calendar that would add every current user in the organization with certain
    permissions such as "reviewer" or "availabilityonly".
    Thanks for the help!

    Hi,
    A possible solution is to do this via Security Groups.
    Add-MailboxFolderPermission -Identity [email protected]:\Calendar -User [email protected] -AccessRights Owner
    This way, you simply add users that require access to the CalendarOwnerAccessGroup
    You still have to run this on every mailbox that should have this feature, but that could be solved using powershell piping.
    http://technet.microsoft.com/en-us/library/ee176927.aspx
    /Anders Eide

  • How to add calendar enries to all users in organization using powershell and EWS.

    I am one of the exchange admins for our organization.  Every year, we publish academic calendar data to all faculty and staff calendars.  We recently updated and migrated from Exchange 2003 to Exchange 2010 which, of course, desupported MAPI and
    ADO.  The processes we previously used had to be re-written using Exchange Web Services API (EWS).  Because I find that powershell is easy to work with, I wanted to integrate the calendar dispersal using powershell.
    Having not found much help online using the EWS .NET library in powershell for this purpose, I decided to share my code:
    # Bulk load calendar entries script
    # Description:
    # Script used to deploy Academic Calendar entries to all Exchange account calendars
    # Prerequisites:
    # Service account must have ApplicationImpersonation ManagementRoleAddisgnment
    # New-ManagementRoleAssignment -Name:impersonationRole -Role:ApplicationImpersonation -User:<srv_account>
    # Usage:
    # .\academicCalendar.ps1 calEntries.csv
    # Where calEntries.csv = list of calendar entries to add
    Param ([string]$calInputFile = $(throw "Please provide calendar input file parameter..."))
    $startTime = Get-Date
    $strFileName = "<path to log file>"
    if(Test-Path $strFileName)
    $logOutFile = Get-Item -path $strFileName
    else
    $logOutFile = New-Item -type file $strFileName
    # Load EWS Managed API library
    Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\1.0\Microsoft.Exchange.WebServices.dll"
    # Load all Mailboxes
    $exchangeUsers = Get-Mailbox -ResultSize Unlimited | Select PrimarySmtpAddress
    # Load all calendar Entries
    # Input file is in the following format
    # StartDate,EndDate,Subject
    # 8/29/2011,8/30/2011,First Day of Fall Classes
    $calEntries = Import-Csv $calInputFile
    # Setup the service for connection
    $service = new-object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010)
    $service.Url = new-object System.Uri("https://<CAS_server_URL>/ews/exchange.asmx")
    $service.Credentials = new-object Microsoft.Exchange.WebServices.Data.WebCredentials("<service_account>","<password>","<domain>")
    $totalCount = $exchangeUsers.Count
    $currentCount = 0
    Write-Output "Exchange Version: $service.RequestedServerVersion"
    Write-Output "Mailbox Count: $totalCount"
    # Add message to log file
    $timeStamp = Get-Date -Format "MM/dd/yyyy hh:mm:ss"
    $message = "$timeStamp -- Begin Calendar Deployment `n"
    $message += "Total Exchange Accounts: $totalCount"
    Add-Content $logOutFile $message
    # Perform for each Mailbox
    $error.clear()
    foreach($mailbox in $exchangeUsers)
    $currentCount++
    if($mailbox.PrimarySmtpAddress -ne "")
    # Output update to screen
    $percentComplete = $currentCount/$totalCount
    Write-Output $mailbox.PrimarySmtpAddress
    "{0:P0}" -f $percentComplete
    # Setup mailbox parameters for impersonation
    $MailboxName = $mailbox.PrimarySmtpAddress
    $iUserID = new-object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress,$MailboxName)
    $service.ImpersonatedUserId = $iUserID
    # Indicate which folder to work with
    $folderid = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Calendar)
    $CalendarFolder = [Microsoft.Exchange.WebServices.Data.CalendarFolder]::Bind($service,$folderid)
    # For each entry in the input file
    $error.clear()
    foreach($entry in $calEntries)
    # First check to make sure the entry is not already in the calendar
    # use a calendarview object to pull the entries for the given date and make sure an entry with the same subject line doesnt already exist
    $cvCalendarview = new-object Microsoft.Exchange.WebServices.Data.CalendarView([System.DateTime]($entry.StartDate),[System.DateTime]($entry.EndDate))
    $cvCalendarview.PropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)
    $frCalendarResult = $CalendarFolder.FindAppointments($cvCalendarview)
    $entryFound = $False
    foreach ($appointment in $frCalendarResult.Items)
    if($appointment.Subject -eq $entry.Subject)
    $entryFound = $True
    # If entry was found, then skip this entry
    if($entryFound)
    $entryFound = $False
    else # Create the appointment object and save it to the users calendar
    $appt = New-Object Microsoft.Exchange.WebServices.Data.Appointment($service)
    $appt.Subject = $entry.Subject
    $appt.Start = [System.DateTime]($entry.StartDate)
    $appt.End = [System.DateTime]($entry.EndDate) #For AllDayEvent, end date must be after start date
    $appt.IsAllDayEvent = $True #Set event as "All Day Event"
    $appt.LegacyFreeBusyStatus = "Free" #Make sure free/busy info shows user as "free" rather than "busy"
    $appt.IsReminderSet = $False #Make sure reminder is not set to remind the user of the event
    $appt.Save([Microsoft.Exchange.WebServices.Data.SendInvitationsMode]::SendToNone)
    if($error)
    $timeStamp = Get-Date -Format "MM/dd/yyyy hh:mm:ss"
    $message = $timeStamp + "...Exception Occurred while processing Save for: `n"
    $message += " Account: " + $MailboxName + "`n"
    $message += " Subject: " + $entry.Subject + "`n"
    $message += " Exception: " + $error[0].Exception + "`n"
    Add-Content $logOutFile $message
    $error.clear()
    if($error)
    $error.clear()
    else
    $message = "" + $MailboxName + "`t Success! `n"
    Add-Content $logOutFile $message
    Write-Output $currentCount
    $endTime = Get-Date
    $duration = New-TimeSpan $startTime $endTime
    $totalMin = $duration.TotalMinutes
    # Build and send email notification upon completion
    $body = "The Calendar deployment has completed. `n `n "
    $body += "Start Timestamp: $startTime `n "
    $body += "End Timestamp: $endTime `n "
    $body += "Duration: $totalMin min `n "
    $body += "Exchange accounts affected: $currentCount `n"
    $smtpServer = "<mysmtpserver>"
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $msg = new-object Net.Mail.MailMessage
    $msg.From = "<from_email_address>"
    $msg.To.Add("<to_email_address>")
    $msg.Subject = "Calendar Deployment"
    $msg.Body = $body
    $smtp.Send($msg)
    # Add closing message to log file
    $timeStamp = Get-Date -Format "MM/dd/yyyy hh:mm:ss"
    $message = "Accounts affected: $currentCount"
    Add-Content $logOutFile $message
    $message = "$timeStamp -- Completed in $totalMin min."
    Add-Content $logOutFile $message
    Please let me know if you think I can make any performance modifications.
    Daniel
    --Edit-- I have updated the script for Exchange 2010 SP1, also added logging, error checking and email notifications.  This new script also checks first to make sure the appointment doesn't already exist before adding it.  (To prevent multiple
    entries of the same event... Note: This check, although necessary in my opinion, is very time consuming.)

    Hi Daniel
    I am trying to add addition propertires like TV, Copier etc. to Room Mailbox in Exchange 2010 using following commands:-
    [PS] C:\Windows\system32>$ResourceConfiguration = Get-ResourceConfig
    [PS] C:\Windows\system32>$ResourceConfiguration.ResourcePropertySchema+=("Room/Whiteboard")
    Upper two commands run fine but following command gives error:-
    [PS] C:\Windows\system32>Set-ResourceConfig -ResourcePropertySchema $ResourceConfiguration.ResourcePropertySchema
    The term 'Set-ResourceConfig' is not recognized as the name of a cmdlet, function, script file, or operable program. Ch
    eck the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:19
    + Set-ResourceConfig <<<<  -ResourcePropertySchema $ResourceConfiguration.ResourcePropertySchema
        + CategoryInfo          : ObjectNotFound: (Set-ResourceConfig:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    I also tried with space after set but still getting error:
    [PS] C:\Windows\system32>Set -ResourceConfig -ResourcePropertySchema $ResourceConfiguration.ResourcePropertySchema
    Set-Variable : A parameter cannot be found that matches parameter name 'ResourceConfig'.
    At line:1 char:20
    + Set -ResourceConfig <<<<  -ResourcePropertySchema $ResourceConfiguration.ResourcePropertySchema
        + CategoryInfo          : InvalidArgument: (:) [Set-Variable], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SetVariableCommand
    Pl advise the solution at [email protected] . I got this help from
    http://zbutler.wordpress.com/2010/03/17/adding-additional-properties-to-resource-mailboxes-exchange-2010/

  • Download RSS feed as xml file from Sharepoint Online using PowerShell

    Hello
    Our company sharepoint (Office 365) contains also several RSS feeds.
    How it is possible to download xml file out of this feed (website) using PowerShell?
    I can authenticate with sharepoint using CSOM but do not what to do next.
    As service user is not administrator I cannot use "SPOService".
    This script works OK for standard website, but not for Sharepoint.
    $doc = New-Object System.Xml.XmlDocument
    $doc.Load("http://www.{CompanySite}.com/feed/")
    $doc.save("C:\temp\feed.xml")
    I am getting this error when using for company Sharepoint:
    "The remote server returned an error: (403) Forbidden."
    Thanks for your time considering this question.
    Jozin

    Hi Scott,
    thanks for advice.
    Combination of WebClient and Sharepoint Credentials is working OK:
    $client = New-Object System.Net.WebClient 
    $client.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User, $SecurePassword)
    $client.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f")
    $client.DownloadFile($SiteURL, $file)

  • Is it possible to use Powershell to determine if Windows Server Source Files are present on disk?

    Hi everyone,
    I would like to know if it is possible to use a Powershell cmdlet to determine if Windows Server 2012 (R2) Source Files are present on disk.
    We are using an automated PS script to install roles and features and some registry keys and applications afterwards. If the Source Files are not present, the script will fail, so I would like a# Check if Source Files are present # stage built in
    the script to determine if the source files are present or that an alternate source path needs to be used.
    Is this possible with Powershell and if so, how can we achieve this?
    I'll appreciate your answer.
    - Rob

    Hi Rob,
    I assume that you are using powershell command "install-windowsfeature" .
    I would suggest you add the parameter "-source" to specify the alternate path of thesource file .
    " The path specified in this parameter is only used if the command cannot find feature files in the local side-by-side store of the specified target computer or VHD. "
    For details please refer to the article below :
    https://technet.microsoft.com/en-us/library/jj205467(v=wps.620).aspx
    Best Regards,
    Elton Ji
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

  • How to update managed metadata column for all file in document library using powershell

    Hi,
    How to update managed metadata column for all file in document library using powershell?
    Any help on it.
    Thanks & REgards
    Poomani Sankaran

    Hi TanPart,
    I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation  Document Library.But i am getting below error in powershell.
    Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
    Could you tell me which is the issues in it?
    See the code below.
    $web = Get-SPWeb http://ntmoss2010:9090/Site
    $list = $web.Lists["DocLib"]
    $query = New-Object Microsoft.SharePoint.SPQuery
    $query.ViewAttributes = "Scope='Recursive'";
    $query.RowLimit = 2000
    $caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
            '<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
    $query.Query = $caml
    do
        $listItems = $list.GetItems($query)
        $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
        foreach($item in $listItems)
            #Cast to SPListItem to avoid ambiguous overload error
            $spItem = [Microsoft.SharePoint.SPListItem]$item;
            Write-Host $spItem.Title       
    while ($spQuery.ListItemCollectionPosition -ne $null)
    Thanks & Regards
    Poomani Sankaran

  • How can i deploy sandboxed solution .wsp file to sharepoint 2013 online using powershell script?

    Is there any way to deploy the Sandbox solution .wsp file to sharepoint 2013 online publishing site using powershell or CSOM or any other way?

    Hi,
    According to your post, my understanding is that you wanted to deploy sandboxed solution .wsp file to sharepoint 2013 online.
    "Add-SPSolution" command is not available in SharePoint Online management shell. So, we cannot use PowerShell to update and deploy a solution in SharePoint Online environment. Meanwhile, here is index of Windows PowerShell for SharePoint Online
    cmdlets for your reference:
    http://technet.microsoft.com/en-us/library/fp161364.aspx
    You can CSOM to deploy solution using helper class from CodePlex. The activation code is as follows: SandboxSolutions.ActivateSolution(siteCollectionURl, cookies, "solution_name.wsp");
    About the Client Side Object Model (CSOM), it is a development related issue, we have a specific support channel for the SharePoint developers, so I recommend you go to our MSDN forum for further assistance.
    Here is a similar thread for you to take a look at:
    http://community.office365.com/en-us/forums/156/t/197404.aspx
    In addition, if you would like to upload and activate sandbox solution manually, you can refer to:
    http://community.office365.com/en-us/forums/154/p/64010/244496.aspx#244496
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for

  • How to identify the project in CMOD used for a particular data source

    Hi   I had a Business Content Data source which is enhanced with ZZ fields and user exit is written in CMOD.   How can i find in which project used to write the code for that particular data source..... When i check CMOD i can find nearly 10 to 20 di

  • Invoking WSDL with SOAP-Encoded Arrays get Errors

    Hi, i am invoking a web service through a partner link. This WSDL hava a SOAP-Encoded Arrays. <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IApWebService

  • New Tabs are not opening

    After upgrading to Firefox 4, I had problems loading son my educational websites. So I decided to downgrade to 3.6.6. After 2 days of downgrading, I can't open new tabs. I press the + button, but nothing happens. Can someone help me with this please?

  • Cannot connect local database using net service_name

    Good Morning to all ; FYI : This  question wrongly posted under high availability. Now it was removed from there. I am trying to connect my local database  using remote authentication. but getting error. Client & Server reside on same  server. SQL> c

  • Using NetBeans

    This is first time I am using netbeans. I am facing problem related to compilation. I hv two packages, so I mounted root directory of each pkg. But while compile 2nd package I m getting package does not exist error. In 2nd package I am refering class