header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Account Expiration Report and email
Last Post 29 Nov 2011 11:08 AM by Karl Mitschke. 4 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jbotsfordUser is Offline
New Member
New Member
Posts:2
Avatar

--
29 Nov 2011 10:11 AM

    Found a great script at http://www.robertwmartin.com/?p=146 that I am having a heck of a time getting to work. Throws multiple "unexpected token" errors. Any help would be greatly appreciated.


    accounts.txt

    Marco ShawUser is Offline
    Veteran Member
    Veteran Member
    Posts:1684
    Avatar

    --
    29 Nov 2011 10:21 AM
    You will have to provide more information on the errors you're getting. There is also pre-req software like the Quest AD cmdlets that you need.


    jbotsfordUser is Offline
    New Member
    New Member
    Posts:2
    Avatar

    --
    29 Nov 2011 10:49 AM
    My understanding is this script does not require the Quest AD cmdlets, rather it uses the active directory module in powershell (being run on a lab 2008R2 DC).


    Unexpected token '}' in expression or statement.
    At C:\accounts.ps1:114 char:3
    + } <<<<
    + CategoryInfo : ParserError: (}:String) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken

    Thanks for the response.

    JB


    Marco ShawUser is Offline
    Veteran Member
    Veteran Member
    Posts:1684
    Avatar

    --
    29 Nov 2011 10:54 AM
    Ah you're right. You should use the the v2 PowerShell ISE to review the code. Looks like the copy and paste has screwed things up and you might be simply missing a bracket (or have too many).


    Karl MitschkeUser is Offline
    Basic Member
    Basic Member
    Posts:457
    Avatar

    --
    29 Nov 2011 11:08 AM
    Try a simple Search & replace of ' “@' with '“@'

    That is, the "@ of a Here String cannot have leading white space.

    Karl


    http://unlockpowershell.wordpress.com
    Co-Author, Windows PowerShell 2.0 Bible
    -join("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer