New-CMDeviceVariable not working with -device parameter (PSTypeName mismatch)

Hi everyone,
I have a problem with the New-CMDeviceVariable powershell command in SCCM 2012 R2. My script does something like this:
$ClientID = 'GUID:xxxx-xxxxxxx-xxx-xx'
$variable = @('Test','ValueTest')
# Get device properties
$Device = Get-CMDevice -name $ComputerName | ?{$_.SMSID -eq $ClientID}
# Add Device variable
New-CMDeviceVariable -IsMask $false -Device $Device -VariableName $variable[0] -VariableValue $variable[1] -ea 1
This results in the following error:
New-CMDeviceVariable : Cannot bind argument to parameter 'Device', because PSTypeNames of the argument do not match the PSTypeName required by the parameter: IResultObject#SMS_R_System.
So the command expects input of type IResultObject#SMS_R_System while the Get-CMDevice command outputs
IResultObject#SMS_CombinedDeviceResources. The technet article of the New-CMDeviceVariable clearly states that the correct way to get the device object is through the Get-CMDevice command (see
article).
The only way to get this command to work is to use the -DeviceName parameter. Sadly, we have had issues in our test environment where we'd have multiple CMdevices with the same name, hence the SMSID solution. The only other option would be to use the -DeviceID
parameter. However, I've not been able to get this working using $device.resourceID as a value (which I assume is the ID the command needs). This fails without an error.
Can anyone explain what the proper way is to get around this issue? I've been racking my brain but I can't seem to find a solution for this.
Sincerely,
MicaH

I'm not sure what the difference is, but with me it runs without problems by using Get-CMDevice. Minor detail, the result is the same as with your other option(s), it doesn't create the variable...
At this moment a workaround could be to use WMI and do something like this:
http://www.sepago.de/e/david/2012/05/08/create-machine-variables-in-configuration-manager-2012
My Blog: http://www.petervanderwoude.nl/
Follow me on twitter: pvanderwoude

Similar Messages

  • Itunes 10.4 update does not work with devices - no itunes store - a bug???

    Hi there,
    I have recently downloaded the new iTunes 10.4 and it now won't open the iTunes store or bring up any devices that I plug into the computer. This means I can not sync my iPad, my iPhone and chage any of my settings. Also, when I go to the iTunes search and type in a song that i want to play, it doesn't work, it doesn't search at all... nothing happenes.
    When I plug my iPhone in to the computer the iPhoto comes up to sync so the lead and the computer under that mechanism is working. It just wont show up in my iTunes.
    Every time I quit iTunes a message comes up with errors and asks me to reopen iTunes. The problem still persists.
    Please advise.

    I am having similar problems after clicking yes when Software Update advised I needed OSX & iTunes update. I'm running Snow Leopard, and now I cannot open iTunes, run  iTunes on my computer, siync my iPod, anything. I wish I had NEVER clicked yes...

  • New Display Not Working With Mac Pro

    I just ordered a new Mac Pro and 24-inch Cinema Display. About 15 minutes ago I plugged everything in and turned it on. Nothing. The screen is blank.
    I made sure everything (power cord, Mini Display Port) was plugged in. Still nothing.
    What can I do?

    Pardon me if you see this in other places - the problem drove me crazy, and I've read about it all over the place but could not find a definite fix.
    I'm using the 24" LED Cinema Display with my new MBP 17 and had the same problem: plug in the monitor's mini DisplayPort and nothing. Sound worked, and my attached USB peripherals (keyboard and mouse) worked fine, but there was no display.
    Reboot doesn't fix it. Zapping PRAM doesn't fix it. Reconnecting the DisplayPort doesn't work.
    I figured out quickly I had to follow these instructions when using it in "clamshell" mode..
    http://support.apple.com/kb/HT3131
    But that isn't going to apply to your Pro. But somewhere - sorry, I would reference it but can no longer find where I got the suggestion - someone gave me the idea to try deleting preferences files until something changed.
    Luckily, I got it on the first try..
    Macintosh HD -> Library -> Preferences -> SystemConfiguration
    ..and move or delete the com.apple.PowerManagement.plist file.
    I plugged the monitor back in and it worked INSTANTLY, like a charm.
    There must be a bug somewhere. I swear it worked better in Leopard and started in Snow Leopard, but there seem to be other people reporting the same or a very similar problem on Leopard as well.

  • "Open link in new tab" not working with Safari and new Yahoo Mail won't open in new tabs.  Yahoo says it is a Safari issue.  I don't think so.

    Any ideas? 
    Works fine in classic Yahoo mail.  But in the "new" Yahoo mail, there is not even an option to open in new tab when I right click the message to be opened.  Interestingly enough, I can right click open to new tab on any other link on the same page that the emails are listed in.
    Anyone encounter this?  Have a solution?
    Thanks.

    From your Safari menu bar click Safari / Reset Safari. Select the top 7 buttons, click Reset.
    If that didn't help, try troubleshooting the Safari .plist file.
    Quit Safari.
    Open a Finder window. Select your Home Folder in the Sidebar on the left. It has a small house icon. Then open the Library folder then the Preferences folder.
    Move the com.apple.Safari.plist file from the Preferences folder to the Desktop. Relaunch Safari. Try Yahoo / tabs. If it functions as it should, move the .plist file to the Trash. Otherwise move it back to the Preferences folder.
    And check Safari / Preferences - Extensions. If you have any installed, turn that off, quit then relaunch Safari. Try again.

  • Why do the new earphones not work with 1st Generation iPod touch?

    Does the 1st generation iPod touch not "recognise" [recognize if you are American] these functions? I am talking about the microphone and the button on the new earphones.

    Ray2104 wrote:
    Then why don't apple make ear phones with microphone which the 1st gen itouch will recognised...
    Because the Touch is primarily a music player, that is what I purchased and I'm quite satisfied with it as it is.
    I'm so fed up of the way Apple Market...
    What are their plans for their consumers... to
    to keep buying new Ipods?!?!?!
    Err...Yes! Welcome to the real world.
    3G Iphone was released shortly after the Iphone...
    why couldnt they make us wait longer...and get the 3G
    You still don't understand this commercial world do you?
    same with Ipod Touch... yes i Understand new Gen ipods...would have better features...
    Let's all wait a hundred years when they bring out the the brain implants...
    But hey wats up with making us fall with Apple...we like the designs, the features...but why then bring in new ones that apple know will not let our old ipods adapt to it.
    You like the design, you buy it, enjoy what you have and don't get so jealous.
    Sick of Apple... they do it on purpose... I guarantee...
    No way?!
    the new Iphone to realease next year....would be Iphone 8.0 mega pixels camera video recording....either way...they would make their customers regret for buying their old Iphones and Ipods...
    If so, then I might buy one, but then I wouldn't moan if a better one was released six months later.
    4 now, do something about the new ear head phones....cos apart of app store and applications...we want to be ablt to use microphones...to communicate on social networking...and voice memos...
    This maybe because the hardware is simply incompatible, they cannot cover every eventuality, had they done so the Touch would have been more expensive and I would not have bought one.
    Technology moves on, fact. I you don't feel Apple are playing fair then just avoid their products, that'll learn 'em.
    By the way, if you want Apple to hear your thoughts go here - [Feedback|http://www.apple.com/feedback/ipodtouch.html]
    They do not officially monitor this board.
    Regards,
    Dud.
    Message was edited by: Duddo

  • "Open Link in new window" not working with OBIEE 10.1.3.4

    Hi All,
    Recently we upgraded from Siebel Analytics to OBIEE 10.1.3.4.
    In OBIEE Go to Settings > Administration > Managae Interactive Dashboard > Select any Dashboard > Right Click on Properties tab > Open Link in New window:
    This throws an error saying "javascript:void(null)".
    In Siebel Analytisc the above functionality used to work.
    Does anyone knows thereason behind this?
    Regards,
    Apoorv

    Get Firebug and inspect the element. You'll see that it actually is this:
    onclick="javascript:saw.runThis
    URL('saw.dll?PortalProperties&_scid=To2OnvCVXpY&PortalPath=/shared/paint/_portal/PoC\x2520FINS&Done=ManagePortals\x2526Done\x253dAdmin');return false" href="javascript:void(null)" FF doesn't even give you the "Open..." options and all IE versions as of 7 show them but actually don't do anything when you invoke them.
    Edited by: Christian Berg on Sep 9, 2009 10:36 AM

  • New canon70d not working with current version of photoshop

    I just got the new Canon 70D and I went to photoshop to edit my picture (I just got the cloud version today) and it won't open my files...  I went to the help files and does not even support my camera, so I was wondering when they where going to update this.

    I'm moving this post from this forum for photoshop-dot-com (an online portal) to the correct forum for Photoshop pro users like yourselves.  FYI, the correct forum URL is: http://forums.adobe.com/community/photoshop
    Kind regards,
    Charlie

  • New iTunes not working with iPad

    I updated iTunes and now when I plug into my computer I get the message " thisiPad cannot be used because the required software is not installed. Run the iTunes installer to remove iTunes then install iTunes again."
    But if I do that will I loose all my apps?

    You may be loose your apps. However, you can re-download them for free using the same account you used the first time. When you do that it will say you already downloaded and ask if you want to download again. Your receipt will show $0.00.

  • Web Report not working with parameter form

    Hi,
    I have a report which has got a parameter form. This report is
    running fine in client/server environment. But when I deploy the
    same report on web (CGI) using PARAMFORM=YES, I am getting the
    parameter form and after pressing the SUBMIT button I am getting
    a blank report under the following two cases even though I have
    data for that query:
    CASE1: <input type="hidden" name="desformat" value="html">
    then I am getting the report with no data retrieved.
    CASE2: <input type="hidden" name="desformat" value="pdf">
    then I am getting completely blank report (no logo, no column
    titles, etc.)
    See the HTML code below. Remember, the same thing is running
    fine in client/server environment. Moreover, if I make a HTML-
    coded form for the report then everything on the client's
    browser is running fine. But this is not what we want, 'coz we
    are running the "BEFORE PARAMETER FORM" trigger in the report.
    So, should I conclude that web-reports does not work with the
    parameter forms?? Is it a bug???
    Regards
    Moiz
    ----------HTML Code------------------
    <form action="http://pc-oracle1.ri.kfupm.edu.sa/cgi-
    bin/rwcgi60.exe">
    Select the Weekend Date for which you would like to see your
    Timesheet report
    <input type="hidden" name="server" value="repserver">
    <input type="hidden" name="report" value="timesheet.rdf">
    <input type="hidden" name="userid" value="696122/696122@ors">
    <input type="hidden" name="destype" value="cache">
    <input type="hidden" name="desformat" value="html">
    <input type="hidden" name="paramform" value = "yes">
    <input type="submit" value="Run Report">
    </p>
    </form>
    -------HTML Code END------------------
    null

    No pal, that's not the problem. The problem lies with the
    "BEFORE PARAMETER FORM" report trigger on the web. Check this
    out on ur report server and u will understand my problem.
    Moiz
    Ramonito Te (guest) wrote:
    : I think the cause is the missing question mark after
    rwcgi60.exe.
    : Anyway here is my html file that runs under cgi. Hope this
    helps.
    : <HTML>
    : <!--Form Action is RWCGI60 URL-->
    : <FORM METHOD=POST
    : ACTION="http://ntserver1/ows-bin/rwcgi60.exe?" METHOD="POST">
    : <!--Parameters not exposed to user are hidden-->
    : <INPUT name=server type=hidden value="ReportsServer">
    : <INPUT name=paramform type=hidden value="yes">
    : <CENTER><H1>Set Reports Multi-tier Server Parameters </H1>
    Report Name: <INPUT name=report type=text value="c:
    : \orant\webdemo\deptemp.rdf">
    : Database Connection: <INPUT name=userid type=text
    : value="scott/tiger@orcl81">
    : <INPUT name=destype type=hidden value="cache">
    : Output Format: <SELECT name=desformat> <OPTION value=HTMLCSS
    : selected> HTMLCSS <OPTION
    : alue=PDF> PDF </SELECT>
    : <HR><INPUT type=submit value="Run Report!">
    : </CENTER> </FORM> </HTML>
    : lue="Run Report!">
    : </CENTER> </FORM> </HTML>
    : M. Moizuddin (guest) wrote:
    : : Hi,
    : : I have a report which has got a parameter form. This report
    : is
    : : running fine in client/server environment. But when I deploy
    : the
    : : same report on web (CGI) using PARAMFORM=YES, I am getting
    the
    : : parameter form and after pressing the SUBMIT button I am
    : getting
    : : a blank report under the following two cases even though I
    : have
    : : data for that query:
    : : CASE1: <input type="hidden" name="desformat" value="html">
    : : then I am getting the report with no data retrieved.
    : : CASE2: <input type="hidden" name="desformat" value="pdf">
    : : then I am getting completely blank report (no logo, no
    column
    : : titles, etc.)
    : : See the HTML code below. Remember, the same thing is running
    : : fine in client/server environment. Moreover, if I make a
    HTML-
    : : coded form for the report then everything on the client's
    : : browser is running fine. But this is not what we want, 'coz
    we
    : : are running the "BEFORE PARAMETER FORM" trigger in the
    report.
    : : So, should I conclude that web-reports does not work with
    the
    : : parameter forms?? Is it a bug???
    : : Regards
    : : Moiz
    : : ----------HTML Code------------------
    : : <form action="http://pc-oracle1.ri.kfupm.edu.sa/cgi-
    : : bin/rwcgi60.exe">
    : : Select the Weekend Date for which you would like to see your
    : : Timesheet report
    : : <input type="hidden" name="server" value="repserver">
    : : <input type="hidden" name="report" value="timesheet.rdf">
    : : <input type="hidden" name="userid" value="696122/696122@ors">
    : : <input type="hidden" name="destype" value="cache">
    : : <input type="hidden" name="desformat" value="html">
    : : <input type="hidden" name="paramform" value = "yes">
    : : <input type="submit" value="Run Report">
    : : </p>
    : : </form>
    : : -------HTML Code END------------------
    null

  • New iSync 2.2 still not working with Nokia 6230

    I was very pleased to see iSync 2.2 come out yesterday and have support for the series 40 phones - however after Installing 10.4.6 on my new MacBook Pro, and opening iSync, the phone is found by Add Device, but when I go to add it I get the message:
    "Your phone, 'xxxx' does not work with this version of iSync.
    To enable this phone to work with iSync, contact the phone’s manufacturer or your service provider to update the firmware on your phone. For more information, visit the iSync Support website."
    The picture comes up but even if I drag the phone icon to the iSync window I can not sync it - 'Turn on Device Synchronization' will not stay ticked and clicking on Sync ends in a window saying it can't sync until I add a device to iSync.
    The Phone is properly paired with the computer through Bluetooth Device Setup. (Address Book works with it just fine, as does file browsing)
    Has anyone been able to get their series 40 or more specifically 6230 phones working with iSync 2.2?
    Many thanks
    Mark Burton

    Same error message here.
    I upgraded the phone's firmware from 4.44 to 5.50 this morning and IT WORKS great with iSync 2.2!!!!!
    Thank you Apple.
    Vangelis
    I was very pleased to see iSync 2.2 come out
    yesterday and have support for the series 40 phones -
    however after Installing 10.4.6 on my new MacBook
    Pro, and opening iSync, the phone is found by Add
    Device, but when I go to add it I get the message:
    "Your phone, 'xxxx' does not work with this version
    of iSync.
    To enable this phone to work with iSync, contact the
    phone’s manufacturer or your service provider to
    update the firmware on your phone. For more
    information, visit the iSync Support website."
    The picture comes up but even if I drag the phone
    icon to the iSync window I can not sync it - 'Turn on
    Device Synchronization' will not stay ticked and
    clicking on Sync ends in a window saying it can't
    sync until I add a device to iSync.
    The Phone is properly paired with the computer
    through Bluetooth Device Setup. (Address Book works
    with it just fine, as does file browsing)
    Has anyone been able to get their series 40 or more
    specifically 6230 phones working with iSync 2.2?
    Many thanks
    Mark Burton

  • Line-in not working with new driv

    Has anyone else had issues with the line-in jack not working with new drivers? Is there a way to get it to work??Very frustrated. Is there a link to the beta drivers, they worked better for me then the new one.

    The line input on the mini requires a 'line-level' signal, so the only microphones that work are ones that have an amplified output. Standard mics don't generate enough voltage to drive the mini's amplifiers.
    That's the reason the mics work with the Griffin device (it has an amplifier) but not the mini directly.

  • HT201412 Safari could not open the page because the server stopped responding- new ipad mini's (2 from separate places) are not working with At & T router but computers work. Can you please help me. I've tried everything. Thanks ya'll!

    Safari could not open the page on my new ipad mini's because the server stopped responding- new ipad mini's (2 from separate places) are not working with At & T router but computers work fine. Yesterday I got it to work. Weird. Can you please help me. I've tried everything. Thanks ya'll!

    Hello SavannahSweetie,
    I was looking into the issue you are desribing, and found a great article for troubleshooting wifi connections with iOS devices. It's called iOS: Troubleshooting Wi-Fi networks and connections and can be found here: http://support.apple.com/kb/ts1398.
    Start with this section, and work your way down if needed.
    Basic troubleshooting
    Tap Settings > Wi-Fi and turn Wi-Fi off and then on again.
    Verify that you are in range of your Wi-Fi router or base station.
    Confirm that your Wi-Fi router and Cable/DSL modem are connected to power and turned on.
    Check whether other devices (portable computers, for example) are able to connect to the Wi-Fi network and access the Internet.
    Update your Wi-Fi router to the latest firmware.For AirPort Base Stations, refer to this article for information about firmware updates. For third-party Wi-Fi routers, check the manufacturer's website for details on updating your firmware.
    Restart your iOS deviceHold the On/Off button until "slide to power off" appears. Slide to power off your device. When it is off, press the On/Off button to turn it back on.
    All the best,
    Sterling

  • New small WIRED keyboard not working with bootcamp

    Greetings from Stuttgart, Germany
    I just bought one of these new small WIRED keyboards for my macbook pro (early 2008/not unibody).
    It's working fine with OSX but not with my bootcamp vista business x64: the fn-key is not recognized. After inspecting the device manager I found out that the keyboard is not recognized as an Apple keyboard like my old one (with numeric keys).
    Afer updating bootcamp to version 2.1 I uninstalled the keyboard from the device manager, plugged it in again and it was still not recognized as an Apple Keyboard
    Is there a way to manually force vista to use apple keyborad driver? Or is there an update for bootcamp on its way to solve the problem?
    Best wishes,
    Wolfgang Gross

    UPDATE: a possible solution that is NOT working:
    in device manager, for both USB Human interface devices associated to the a hardware id (05AC/021E) of the keyboard:
    Update driver > browse my computer.. > let me pick.. > show compatible hardware.. > Apple Inc./Apple keyboard 2.1.0..
    Doesn't change the keyboard (mis-)behaviour

  • Zen Micro Photo not working with new XP SP2 install

    Okay so my Zen Micro Photo stopped being recognised on my computer about ten months ago when I upgraded to WMP (for BBC iPlayer - it's compulsory to have it). Anyway I li'ved with this and have now got thoroughly sick of the same songs and nothing new so I have done a fresh install (on a brand new hard dri've) of Windows XP SP2 WMP9 with the sole intention of using this install/hard dri've?for the player. I used the original installation disk and it prompted me to upgrade to WMP0 as I installed everything. There were no errors during the install and I rebooted when prompted to.
    When I attach the player it is recognised by the machine (task bar icon and correctly labelled in System > Hardware > Device Manager which reports it to be?working okay) but the Creative media software says "player not attached" when it is. It is not visible on My Computer as a dri've so I STILL have no access to the player. Player screen reports "docked" with a logo and is flashes a charging icon. Driver v5.2.0.0. The player plays fine but hasn't had new music on in almost a year
    There is nothing else on the XP install (IE6 and everything - argh!) I did the registry permission tweak thing mentioned?here:?http://support.creative.com/kb/showa....aspx?sid=9287?but it didn't do anything.
    Any help greatfully received!

    Re: Zen Micro Photo not working with new XP SP2 install. Have you installed this plug-in?
    Creative PlaysForSure Devices Plugin 5.00.36 for Creative MediaSource 5 Player/Organizer
    Filesize : 27.9 MBDownload

  • Apps not working with docomo after updating new sw...

    hello brother,
    i have updated my nokia c2-00 sw v3.99 .
    After updating new sw v.3.99 my apps not working with tata docomo only .
    Docomo is my personal sim-card.
    What can do for get ride it.
    Solved!
    Go to Solution.

    Hello, Premkoli. Which specific apps are you referring to? Are these apps downloaded from the Store, or preloaded ones? When you say 'my apps not working with tata docomo only', does it mean that these apps work with other SIM cards aside from TaTa Docomo? How did you update your Nokia C2-00? Is it by going to Settings > Phone > Device Updates > Check for updates, or via Nokia Suite?
    Since the issue started after the software update, you can try to reinstall the phone's SW via Nokia Suite. Just download it on your PC, and then connect the phone via a compatible USB cable. After that, launch Nokia Suite, and the go to SW Updates > Device Software Updates > Reinstall current SW. After that, try opening the same apps and see if they'll work with your Docomo SIM card. Get Nokia Suite from this link: Nokia Suite
    Let us know the outcome. 

Maybe you are looking for

  • "Show Desktop" bug forces any program windows to be stuck "Always-on-top"

    What I found under Windows 7, when you use the "Show Desktop" feature (I prefer the ⊞ Win + D shortcut) and then bring all windows back by using it again, some windows behave as if they're glued to the front of the z-order. What this means is, say, I

  • Need Advice about PPL Usage

    LV 2013, LVRT 2013 (PXI), Win 7 I'm an old hand at LabVIEW, but I'm new to using Project Libraries (.lvlib) and Packed Project Libraries (.lvlibp). I'm hoping someone with more experience can offer some insight and guidance. At first blush, it looks

  • HDMI CONNECTION

    I just purchased a mac mini. Problem that I am having is that I am getting an image through the HDMI connection. I use a LCD tv as a monitor with a HDMI imput. It will work through the thunderbolt port with my mini display to vga adapter. Do I have t

  • When transferring HR data from ECC to CRM via change pointers

    When transferring HR data from ECC to CRM via change pointers ,certain data is getting earsed in CRM paricularly the last name and first name of BUT000 Do you have any idea why this could be happening Thanks in advance

  • Using UTL_TCP to post xml

    All, we were using UTL_HTTP for XML post and retrieve result. It kept running into transfer_timeout trouble (oracle 9.2.*) So now we are trying to use UTL_TCP to post xml. But I am not sure how the sequence will be. I woulc apppreciate if you guys co